From d65430137d1341fb9b0ee76760d10ed74b8d386a Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 18 May 2014 21:31:43 +0200 Subject: [PATCH] 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 --- WINGs/wbrowser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/WINGs/wbrowser.c b/WINGs/wbrowser.c index 03b75ad2..6ef110e1 100644 --- a/WINGs/wbrowser.c +++ b/WINGs/wbrowser.c @@ -781,6 +781,7 @@ WMArray *WMGetBrowserPaths(WMBrowser * bPtr) for (i = 0; i <= column; i++) { if (wstrlcat(path, bPtr->pathSeparator, slen) >= slen) { wfree(path); + WMFreeArray(paths); return NULL; } if (i == column) {