[PATCH 08/15] libmtd: don't leak temporary buffers

David Oberhollenzer david.oberhollenzer at sigma-star.at
Sun Nov 10 07:30:52 PST 2019


Signed-off-by: David Oberhollenzer <david.oberhollenzer at sigma-star.at>
---
 lib/libmtd.c | 1 +
 1 file changed, 1 insertion(+)

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




More information about the linux-mtd mailing list