From: Flole998 Date: Fri, 7 Oct 2022 18:59:52 +0000 (+0200) Subject: Fix potential memory leak X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9b76b57e1826240c98dd4b63c3b294bca143486;p=thirdparty%2Ftvheadend.git Fix potential memory leak --- diff --git a/src/file.c b/src/file.c index 5043d9a8b..e23036891 100644 --- a/src/file.c +++ b/src/file.c @@ -46,6 +46,11 @@ size_t file_readall ( int fd, char **outp ) totalsize += r; } + if (!totalsize) { + free(outbuf); + return 0; + } + *outp = outbuf; if (totalsize == outsize) { n = realloc(outbuf, outsize += 1);