Zhiyi Zhang : oledb32/tests: Fix memory leaks.
Module: wine Branch: master Commit: 6b966a888a851459e1a0c241629cf88b64b200f6 URL: https://gitlab.winehq.org/wine/wine/-/commit/6b966a888a851459e1a0c241629cf88... Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 21 10:55:59 2023 +0800 oledb32/tests: Fix memory leaks. --- dlls/oledb32/tests/database.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/oledb32/tests/database.c b/dlls/oledb32/tests/database.c index 67b45737ba8..ebd3cb2fadf 100644 --- a/dlls/oledb32/tests/database.c +++ b/dlls/oledb32/tests/database.c @@ -47,6 +47,19 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line) ok_(__FILE__, line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc); } +static void free_dbpropinfoset(ULONG count, DBPROPINFOSET *propinfoset) +{ + ULONG i, j; + + for (i = 0; i < count; i++) + { + for (j = 0; j < propinfoset[i].cPropertyInfos; j++) + VariantClear(&propinfoset[i].rgPropertyInfos[j].vValues); + CoTaskMemFree(propinfoset[i].rgPropertyInfos); + } + CoTaskMemFree(propinfoset); +} + static void test_GetDataSource(const WCHAR *initstring) { IDataInitialize *datainit = NULL; @@ -90,7 +103,7 @@ static void test_GetDataSource(const WCHAR *initstring) pInfoset->rgPropertyInfos[i].vtType); } - CoTaskMemFree(pInfoset); + free_dbpropinfoset(cnt, pInfoset); CoTaskMemFree(ary); }
participants (1)
-
Alexandre Julliard