ubifs-utils: common: fix memory leak in devtable.c
PATCH 1/1 ubifs-utils: common: fix memory leak in devtable.c
Report of the static analyzer:
Dynamic memory, referenced by 'line', is allocated at devtable.c:356 by calling function 'getline' and lost at devtable.c:388. (line: while (getline(&line, &len, f) != -1) {)
Correct explained:
Now line is freed in any exit scenario via out_close which eliminates this error.
Triggers found by static analyzer Svace.
Signed-off-by Anton Moryakov <[email protected]>
Reviewed-by Zhihao Cheng <[email protected]>
--- ubifs-utils/common/devtable.c | 1 + 1 file changed, 1 insertion(+)
ubifs-utils/common/devtable.c +1 -0
@@ -392,6 +392,7 @@ int parse_devtable(const char *tbl_file) out_close:fclose (f); +free (line);free_devtable_info ();return -1 ; }
--
2.34.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
David Oberhollenzer
AppliedApplied to mtd-utils.git master.
Thanks,
David
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/