Hello,
A free-statement was missing to deallocate the string returned by striponedir(), thanks to the comment in the source code before it.
Valgrind showed loss of 116 bytes instead of 32 bytes as in the comment #0 -
https://savannah.gnu.org/bugs/?47206#comment0. However loss is zero now.
Which one of the following manner is better, former or latter? I kept former as latter breaks the indentation.
Manner #1 -
+ temp = striponedir(filelist[selected]);
+ prev_dir = mallocstrcpy(NULL, temp);
Manner #2 -
+ prev_dir = mallocstrcpy(NULL, (temp = striponedir(filelist[selected]));