Nikolay Sivov : inetcomm: Fix a leak on DeleteProp() (Valgrind).
Alexandre Julliard
julliard at winehq.org
Sun Mar 3 13:21:33 CST 2019
Module: wine
Branch: oldstable
Commit: 5211743a93baf60e8d5643f05aec822ca98a48f8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5211743a93baf60e8d5643f05aec822ca98a48f8
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri Dec 14 03:43:25 2018 +0300
inetcomm: Fix a leak on DeleteProp() (Valgrind).
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 05f6769f24a6db40ac1ea3d60cdbc3ac9c5f2513)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/inetcomm/mimeole.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c
index f0e186c..2b307e1 100644
--- a/dlls/inetcomm/mimeole.c
+++ b/dlls/inetcomm/mimeole.c
@@ -818,16 +818,21 @@ static void empty_param_list(struct list *list)
}
}
+static void free_header(header_t *header)
+{
+ list_remove(&header->entry);
+ PropVariantClear(&header->value);
+ empty_param_list(&header->params);
+ heap_free(header);
+}
+
static void empty_header_list(struct list *list)
{
header_t *header, *cursor2;
LIST_FOR_EACH_ENTRY_SAFE(header, cursor2, list, header_t, entry)
{
- list_remove(&header->entry);
- PropVariantClear(&header->value);
- empty_param_list(&header->params);
- HeapFree(GetProcessHeap(), 0, header);
+ free_header(header);
}
}
@@ -1231,8 +1236,7 @@ static HRESULT WINAPI MimeBody_DeleteProp(
if(found)
{
- list_remove(&cursor->entry);
- HeapFree(GetProcessHeap(), 0, cursor);
+ free_header(cursor);
return S_OK;
}
}
More information about the wine-cvs
mailing list