Rob Shearman : shell32: Fix a potentially large memory leak in IQueryAssociations_fnGetString.
Alexandre Julliard
julliard at winehq.org
Wed Dec 30 10:18:14 CST 2009
Module: wine
Branch: master
Commit: 3547ea011a98fb902c530bec867d28b32f488412
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3547ea011a98fb902c530bec867d28b32f488412
Author: Rob Shearman <robertshearman at gmail.com>
Date: Tue Dec 29 19:02:54 2009 +0000
shell32: Fix a potentially large memory leak in IQueryAssociations_fnGetString.
---
dlls/shell32/assoc.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c
index 85efa07..066e8ba 100644
--- a/dlls/shell32/assoc.c
+++ b/dlls/shell32/assoc.c
@@ -505,7 +505,9 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
/* Does strlenW(bufW) == 0 mean we use the filename? */
len = strlenW(bufW) + 1;
TRACE("found FileDescription: %s\n", debugstr_w(bufW));
- return ASSOC_ReturnData(pszOut, pcchOut, bufW, len);
+ hr = ASSOC_ReturnData(pszOut, pcchOut, bufW, len);
+ HeapFree(GetProcessHeap(), 0, verinfoW);
+ return hr;
}
}
}
@@ -513,7 +515,9 @@ get_friendly_name_fail:
PathRemoveExtensionW(path);
PathStripPathW(path);
TRACE("using filename: %s\n", debugstr_w(path));
- return ASSOC_ReturnData(pszOut, pcchOut, path, strlenW(path) + 1);
+ hr = ASSOC_ReturnData(pszOut, pcchOut, path, strlenW(path) + 1);
+ HeapFree(GetProcessHeap(), 0, verinfoW);
+ return hr;
}
case ASSOCSTR_CONTENTTYPE:
More information about the wine-cvs
mailing list