Fix reported memory leak (strdup without free)

Clean up compiler warnings
This commit is contained in:
Pedro A. Aranda 2017-01-05 13:41:14 +01:00
parent 4a090adef8
commit 652939dd21
1 changed files with 22 additions and 14 deletions

View File

@ -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)