1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00

WINGs: fix memory leak in WMGetBrowserPaths (Coverity #50111)

As reported by Coverity, in the (rare) case where the wstrlcat would fail
the array for the result would not be freed before returning.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-18 21:31:43 +02:00
committed by Carlos R. Mafra
parent 47b801021c
commit d65430137d

View File

@@ -781,6 +781,7 @@ WMArray *WMGetBrowserPaths(WMBrowser * bPtr)
for (i = 0; i <= column; i++) { for (i = 0; i <= column; i++) {
if (wstrlcat(path, bPtr->pathSeparator, slen) >= slen) { if (wstrlcat(path, bPtr->pathSeparator, slen) >= slen) {
wfree(path); wfree(path);
WMFreeArray(paths);
return NULL; return NULL;
} }
if (i == column) { if (i == column) {