Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b54e1ec6
Commit
b54e1ec6
authored
Nov 21, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdasql/tests: Fix memory leaks.
parent
9ba4c100
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
10 deletions
+32
-10
provider.c
dlls/msdasql/tests/provider.c
+32
-10
No files found.
dlls/msdasql/tests/provider.c
View file @
b54e1ec6
...
...
@@ -43,6 +43,32 @@ static char mdbpath[MAX_PATH];
static
const
VARTYPE
intptr_vartype
=
(
sizeof
(
void
*
)
==
8
?
VT_I8
:
VT_I4
);
static
void
free_dbpropset
(
ULONG
count
,
DBPROPSET
*
propset
)
{
ULONG
i
,
j
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
j
=
0
;
j
<
propset
[
i
].
cProperties
;
j
++
)
VariantClear
(
&
propset
[
i
].
rgProperties
[
j
].
vValue
);
CoTaskMemFree
(
propset
[
i
].
rgProperties
);
}
CoTaskMemFree
(
propset
);
}
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_msdasql
(
void
)
{
HRESULT
hr
;
...
...
@@ -125,11 +151,8 @@ static void test_Properties(void)
propidlist
.
rgPropertyIDs
[
i
]
=
propinfoset
->
rgPropertyInfos
[
i
].
dwPropertyID
;
}
for
(
i
=
0
;
i
<
propinfoset
->
cPropertyInfos
;
i
++
)
VariantClear
(
&
propinfoset
->
rgPropertyInfos
[
i
].
vValues
);
CoTaskMemFree
(
propinfoset
->
rgPropertyInfos
);
CoTaskMemFree
(
propinfoset
);
free_dbpropinfoset
(
infocount
,
propinfoset
);
CoTaskMemFree
(
desc
);
hr
=
IDBProperties_GetProperties
(
props
,
1
,
&
propidlist
,
&
propcnt
,
&
propset
);
ok
(
hr
==
S_OK
,
"got 0x%08lx
\n
"
,
hr
);
...
...
@@ -162,7 +185,7 @@ static void test_Properties(void)
}
CoTaskMemFree
(
propidlist
.
rgPropertyIDs
);
CoTaskMemFree
(
propset
);
free_dbpropset
(
propcnt
,
propset
);
}
propid
=
DBPROP_MULTIPLERESULTS
;
...
...
@@ -179,7 +202,7 @@ static void test_Properties(void)
ok
(
propset
->
rgProperties
[
0
].
dwPropertyID
==
DBPROP_MULTIPLERESULTS
,
"got %ld
\n
"
,
propset
->
rgProperties
[
0
].
dwPropertyID
);
ok
(
propset
->
rgProperties
[
0
].
dwStatus
==
DBPROPSTATUS_NOTSUPPORTED
,
"got %ld
\n
"
,
propset
->
rgProperties
[
0
].
dwStatus
);
CoTaskMemFree
(
propset
);
free_dbpropset
(
propcnt
,
propset
);
IDBProperties_Release
(
props
);
}
...
...
@@ -324,7 +347,7 @@ static void test_command_properties(ICommandProperties *props)
}
}
CoTaskMemFree
(
propset
);
free_dbpropset
(
count
,
propset
);
}
static
void
test_command_interfaces
(
IUnknown
*
cmd
)
...
...
@@ -528,8 +551,7 @@ static void test_rowset_info(IRowset *rowset)
propset
->
rgProperties
[
i
].
dwPropertyID
,
row_props
[
i
]);
}
CoTaskMemFree
(
propset
);
free_dbpropset
(
propcnt
,
propset
);
IRowsetInfo_Release
(
info
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment