diff options
author | Christian Lindeberg <christian.lindeberg@sonyericsson.com> | 2011-01-19 12:22:41 +0100 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonyericsson.com> | 2011-01-19 12:22:41 +0100 |
commit | 862c83bb3121de3e3fd4a9c7ebdb8ae627f8d311 (patch) | |
tree | 54152bda82eab71117718b2228d5b027654b5067 /mtdutils | |
parent | c5ebf1fba2f870a4e9453721112900975c18e083 (diff) | |
download | bootable_recovery-862c83bb3121de3e3fd4a9c7ebdb8ae627f8d311.zip bootable_recovery-862c83bb3121de3e3fd4a9c7ebdb8ae627f8d311.tar.gz bootable_recovery-862c83bb3121de3e3fd4a9c7ebdb8ae627f8d311.tar.bz2 |
Free allocated struct after freeing field
Free allocated MtdReadContext after freeing buffer field in struct,
not before.
Change-Id: I237920dc36115389cd2d6948e7a962dbec22fe56
Diffstat (limited to 'mtdutils')
-rw-r--r-- | mtdutils/mtdutils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c index 198f498..e4d2a60 100644 --- a/mtdutils/mtdutils.c +++ b/mtdutils/mtdutils.c @@ -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; } |