mirror of https://github.com/madler/zlib
Fix reported memory leak (strdup without free)
Clean up compiler warnings
This commit is contained in:
parent
4a090adef8
commit
652939dd21
|
@ -14,8 +14,15 @@
|
|||
|
||||
#include "zlib.h"
|
||||
|
||||
#ifdef __unix__
|
||||
# ifndef unix
|
||||
# define unix 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef unix
|
||||
# include <unistd.h>
|
||||
# include <sys/stat.h>
|
||||
#else
|
||||
# include <direct.h>
|
||||
# include <io.h>
|
||||
|
@ -277,6 +284,7 @@ void restore_attr(struct attr_item **list)
|
|||
chmod(item->fname,item->mode);
|
||||
prev = item;
|
||||
item = item->next;
|
||||
free(prev->fname);
|
||||
free(prev);
|
||||
}
|
||||
*list = NULL;
|
||||
|
@ -608,7 +616,7 @@ int main(int argc,char **argv)
|
|||
int action = TGZ_EXTRACT;
|
||||
int arg = 1;
|
||||
char *TGZfile;
|
||||
gzFile *f;
|
||||
gzFile f;
|
||||
|
||||
prog = strrchr(argv[0],'\\');
|
||||
if (prog == NULL)
|
||||
|
|
Loading…
Reference in New Issue