Fix double free when starting in list mode

This commit is contained in:
Arun Prakash Jana 2020-05-05 23:35:14 +05:30
parent a563c1a553
commit 4c18f22587
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -4236,7 +4236,9 @@ static void rmlistpath()
DPRINTF_S(__FUNCTION__); DPRINTF_S(__FUNCTION__);
DPRINTF_S(listpath); DPRINTF_S(listpath);
spawn("rm -rf", listpath, NULL, NULL, F_NOTRACE | F_MULTI); spawn("rm -rf", listpath, NULL, NULL, F_NOTRACE | F_MULTI);
free(listpath); /* Do not free if program was started in list mode */
if (listpath != initpath)
free(listpath);
listpath = NULL; listpath = NULL;
} }
} }