From: Heinrich Schuchardt Date: Sat, 26 Jul 2025 06:31:23 +0000 (+0200) Subject: tools: mkeficapsule: resource leak in read_bin_file() X-Git-Tag: v2025.10-rc2~4^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e16646c0ade9a62ef118978e27adbb259eb8a360;p=pandora-u-boot.git tools: mkeficapsule: resource leak in read_bin_file() Free the allocated buffer in case of an error. Fixes: 9e63786e2b4b ("tools: mkeficapsule: rework the code a little bit") Addresses-Coverity-ID: 345917 Resource leak Signed-off-by: Heinrich Schuchardt --- diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index fb6c57f77c1..0f41cdb64f5 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -168,6 +168,7 @@ static int read_bin_file(char *bin, uint8_t **data, off_t *bin_size) if (size < bin_stat.st_size) { fprintf(stderr, "read failed (%zx)\n", size); ret = -1; + free(buf); goto err; }