[PATCH] winex11.drv: free uriList (Coverity)
Marcus Meissner
marcus at jet.franken.de
Mon Feb 16 01:34:08 CST 2015
1269463 Resource leak
is allocated via HeapAlloc, but was not freed
---
dlls/winex11.drv/clipboard.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index b2705b4..dad4a7a 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -1590,8 +1590,10 @@ static HANDLE X11DRV_CLIPBOARD_ImportTextUriList(Display *display, Window w, Ato
return 0;
out = HeapAlloc(GetProcessHeap(), 0, capacity * sizeof(WCHAR));
- if (out == NULL)
+ if (out == NULL) {
+ HeapFree(GetProcessHeap(), 0, uriList);
return 0;
+ }
while (end < len)
{
@@ -1650,6 +1652,7 @@ static HANDLE X11DRV_CLIPBOARD_ImportTextUriList(Display *display, Window w, Ato
}
}
HeapFree(GetProcessHeap(), 0, out);
+ HeapFree(GetProcessHeap(), 0, uriList);
return handle;
}
--
1.8.4.5
More information about the wine-patches
mailing list