summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mtdutils/mtdutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c
index 198f4989d..e4d2a6064 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;
}