Fix memory leak reported by Coverity

As reported in CID #331577, we re-use the variable 'tmp' without freeing
the previously allocated pointer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS authored and Carlos R. Mafra committed 2021-05-18 17:49:17 +01:00
1 parent fd56152202
commit 97a9300aa4
1 file changed
+5 -1
+5 -1
View File
@@ -673,9 +673,13 @@ static void constructMenu(WMenu * menu, WMenuEntry * entry)
tmp = wexpandpath(path[i]);
if (strstr(tmp, "#usergnusteppath#") == tmp)
if (strstr(tmp, "#usergnusteppath#") == tmp) {
char *old_tmp = tmp;
tmp = wstrconcat(wusergnusteppath(),
tmp + 17);
wfree(old_tmp);
}
wfree(path[i]);
lpath = getLocalizedMenuFile(tmp);