[LEDE-DEV] [LEDE-DEV,2/3] fstools: fix potential memory leak
rosysong at rosinson.com
rosysong at rosinson.com
Thu Mar 29 01:25:01 PDT 2018
Fix potential memory leak in fstools
Signed-off-by: Rosy Song <rosysong at rosinson.com>
---
libblkid-tiny/libblkid-tiny.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libblkid-tiny/libblkid-tiny.c b/libblkid-tiny/libblkid-tiny.c
index ccfaf63..12cab6f 100644
--- a/libblkid-tiny/libblkid-tiny.c
+++ b/libblkid-tiny/libblkid-tiny.c
@@ -282,7 +282,7 @@ int probe_block(char *block, struct blkid_struct_probe *pr)
mag = &idinfos[i]->magics[0];
- while (mag->magic) {
+ while (mag && mag->magic) {
int off = (mag->kboff * 1024) + mag->sboff;
char magic[32] = { 0 };
--
2.13.3
Lede-dev mailing list
Lede-dev at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev
More information about the Lede-dev
mailing list