Skip to contentSkip to conversation

tools: imx8image: Fix potential memory leak

PATCH New Maks Mishin 1 participant 1 message Feb 2, 2025 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: imx8image: Fix potential memory leak

Dynamic memory, referenced by 'line', is allocated at imx8image.c:270 by calling function 'getline' and lost at imx8image.c:294.

---
 tools/imx8image.c | 1 +
 1 file changed, 1 insertion(+)
tools/imx8image.c +1 -0
index 15510d3e71..0135b19095 100644
@@ -290,6 +290,7 @@ static uint32_t parse_cfg_file(image_t *param_stack, char *name)
 		}
 	}
 
+	free(line);
 	fclose(fd);
 	return 0;
 }
Signature · 1 line
2.34.1