[08/15] libmtd: don't leak temporary buffers
diff mbox series

Message ID 20191110153059.28878-9-david.oberhollenzer@sigma-star.at
State New
Headers show
Series
  • mtd-utils: cleanup resource leaks
Related show

Commit Message

David Oberhollenzer Nov. 10, 2019, 3:30 p.m. UTC
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
---
 lib/libmtd.c | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

diff --git a/lib/libmtd.c b/lib/libmtd.c
index 5e3ac50..564e5c0 100644
--- a/lib/libmtd.c
+++ b/lib/libmtd.c
@@ -1140,6 +1140,7 @@  static int legacy_auto_oob_layout(const struct mtd_dev_info *mtd, int fd,
 		memcpy(oob + start, tmp_buf + start, len);
 	}
 
+	free(tmp_buf);
 	return 0;
 }