Fix memory leak

This commit is contained in:
Arun Prakash Jana 2021-06-22 20:51:23 +05:30
parent eae60c3048
commit e7f73d95ce
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 2 additions and 0 deletions

View File

@ -4332,9 +4332,11 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
if (x_to) {
if (chdir(xdirname(fpath)) == -1) {
printwarn(NULL);
free(outdir);
return FALSE;
}
xstrsncpy(fpath, outdir, PATH_MAX);
free(outdir);
} else if (op == 'x')
fpath[0] = '\0';