From: Maks Mishin <maks.mishi...@gmail.com> 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 <maks.mishi...@gmail.com> Signed-off-by: Anton Moryakov <ant.v.morya...@gmail.com> --- tools/aisimage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/aisimage.c b/tools/aisimage.c index b8b3ee32..6091c8d5 100644 --- a/tools/aisimage.c +++ b/tools/aisimage.c @@ -346,6 +346,7 @@ static int aisimage_generate(struct image_tool_params *params, } } + free(line); fclose(fd); aishdr = ais_copy_image(params, aishdr); -- 2.34.1