From: Guido U. Draheim Date: Sun, 4 Aug 2019 18:00:21 +0000 (+0200) Subject: Merge pull request #66 from imartisko/master X-Git-Tag: v0.13.70~2^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89d623631b68e7d5c3fd3cedb85754138d0f7931;p=zziplib Merge pull request #66 from imartisko/master fseeko.c: fix possible double free of buffer --- diff --git a/zzip/fseeko.c b/zzip/fseeko.c index ac66784..3b3145e 100644 --- a/zzip/fseeko.c +++ b/zzip/fseeko.c @@ -420,6 +420,7 @@ zzip_entry_findfirst(FILE * disk) if (zzip_disk_entry_check_magic(entry)) { free(buffer); + buffer = NULL; entry->headseek = root; entry->diskfile = disk; entry->disksize = disksize; @@ -450,7 +451,8 @@ zzip_entry_findfirst(FILE * disk) } errno = ENOENT; /* not found */ error2: - free(buffer); + if (buffer != NULL) + free(buffer); error1: free(entry); ____;