tools: Fix potential memory leak in aisimage.c
PATCH 1/1 tools: Fix potential memory leak in aisimage.c
From: Maks Mishin <[email protected]>
The 'line' variable is dynamically allocated by getline() function during config file parsing but wasn't being freed before function exit, causing memory leak. This was detected by static analysis.
Add missing free() call before closing the file descriptor to prevent memory leak.
Signed-off-by Maks Mishin <[email protected]>
Signed-off-by Anton Moryakov <[email protected]>
--- tools/aisimage.c | 1 + 1 file changed, 1 insertion(+)
tools/aisimage.c +1 -0
@@ -346,6 +346,7 @@ static int aisimage_generate(struct image_tool_params *params, } } +free (line);fclose (fd); aishdr =ais_copy_image (params, aishdr);
Signature · 1 line
2.34.1