diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-11-10 14:55:14 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-11-10 15:30:04 +0100 |
commit | d74d413c0bdc324b677b4b9ec47f89fd3e648faa (patch) | |
tree | dc1d923c38da6d943fb215f6021c352b420cefc5 | |
parent | f4ce3f052539ef536a1dfa7ed433f1814471a754 (diff) |
ftl_format: don't leak temporary buffers
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | misc-utils/ftl_format.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/misc-utils/ftl_format.c b/misc-utils/ftl_format.c index 649984b..bf3c8f2 100644 --- a/misc-utils/ftl_format.c +++ b/misc-utils/ftl_format.c @@ -191,6 +191,7 @@ static int format_partition(int fd, int quiet, int interrogate, fflush(stdout); } perror("block erase failed"); + free(bam); return -1; } erase.start += erase.length; @@ -246,6 +247,9 @@ static int format_partition(int fd, int quiet, int interrogate, break; } } + + free(bam); + if (i < le16_to_cpu(hdr.NumEraseUnits)) return -1; else |