]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix potential memory leak
authorFlole998 <Flole998@users.noreply.github.com>
Fri, 7 Oct 2022 18:59:52 +0000 (20:59 +0200)
committerFlole998 <Flole998@users.noreply.github.com>
Fri, 7 Oct 2022 19:22:43 +0000 (21:22 +0200)
src/file.c

index 5043d9a8bb24db8629ec019073e0e0ca0bdf39ef..e23036891b769ab4093e3d4cabb806d1d47948ce 100644 (file)
@@ -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);