mirror of
https://github.com/VIKINGYFY/immortalwrt.git
synced 2025-12-16 17:15:26 +00:00
See announcement mail for list of new features: https://lists.infradead.org/pipermail/linux-mtd/2025-February/108248.html Cherry pick some upstream commits which fix build problems in some situations. autoreconf fixup is needed now otherwise the build fails with: ``` mtd-utils-2.3.0/missing: line 81: automake-1.16: command not found ``` The code in tests/ubifs_tools-tests/Makemodule.am does not build because some test data is not packaged in the tar files, do not build code from this directory. The size increased only very little: 61498 bin/targets/ramips/mt7621/packages/nand-utils-2.3.0-r1.apk 101643 bin/targets/ramips/mt7621/packages/ubi-utils-2.3.0-r1.apk 61243 bin/targets/ramips/mt7621/packages/nand-utils-2.2.1-r1.apk 101291 bin/targets/ramips/mt7621/packages/ubi-utils-2.2.1-r1.apk Link: https://github.com/openwrt/openwrt/pull/20540 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
33 lines
1.0 KiB
Diff
33 lines
1.0 KiB
Diff
From 2669111e3c60b8e146c174db5d2e7e9991f3dd87 Mon Sep 17 00:00:00 2001
|
|
From: AntonMoryakov <ant.v.moryakov@gmail.com>
|
|
Date: Thu, 24 Apr 2025 21:19:22 +0300
|
|
Subject: 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 <ant.v.moryakov@gmail.co
|
|
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
---
|
|
ubifs-utils/common/devtable.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
--- a/ubifs-utils/common/devtable.c
|
|
+++ b/ubifs-utils/common/devtable.c
|
|
@@ -392,6 +392,7 @@ int parse_devtable(const char *tbl_file)
|
|
|
|
out_close:
|
|
fclose(f);
|
|
+ free(line);
|
|
free_devtable_info();
|
|
return -1;
|
|
}
|