tools: imx8image: Fix potential memory leak
authorMaks Mishin <maks.mishinfz@gmail.com>
Sun, 2 Feb 2025 17:05:17 +0000 (20:05 +0300)
committerFabio Estevam <festevam@gmail.com>
Thu, 27 Feb 2025 12:53:26 +0000 (09:53 -0300)
Dynamic memory, referenced by 'line', is allocated at imx8image.c:270
by calling function 'getline' and lost at imx8image.c:294.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
tools/imx8image.c

index 15510d3..0135b19 100644 (file)
@@ -290,6 +290,7 @@ static uint32_t parse_cfg_file(image_t *param_stack, char *name)
                }
        }
 
+       free(line);
        fclose(fd);
        return 0;
 }