am da993fcf: am 8d58c957: Merge "Free allocated struct after freeing field"

* commit 'da993fcf2665102435b05d6b20a4c4e8f8bd3b8f':
  Free allocated struct after freeing field
This commit is contained in:
Doug Zongker 2011-01-21 16:15:02 -08:00 committed by Android Git Automerger
commit 80abd51dbc

View File

@ -269,8 +269,8 @@ MtdReadContext *mtd_read_partition(const MtdPartition *partition)
sprintf(mtddevname, "/dev/mtd/mtd%d", partition->device_index);
ctx->fd = open(mtddevname, O_RDONLY);
if (ctx->fd < 0) {
free(ctx);
free(ctx->buffer);
free(ctx);
return NULL;
}