Merge "Free allocated struct after freeing field"

This commit is contained in:
Doug Zongker 2011-01-20 07:06:02 -08:00 committed by Android Code Review
commit 8d58c95703

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;
}