Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
84a8ae79
Commit
84a8ae79
authored
Apr 22, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Fix BSTR leaks caused by incorrect use of SafeArrayPutElement() (Valgrind).
parent
f068eb9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
query.c
dlls/wbemprox/query.c
+2
-0
reg.c
dlls/wbemprox/reg.c
+12
-1
No files found.
dlls/wbemprox/query.c
View file @
84a8ae79
...
...
@@ -700,6 +700,7 @@ SAFEARRAY *to_safearray( const struct array *array, CIMTYPE type )
SafeArrayDestroy
(
ret
);
return
NULL
;
}
SysFreeString
(
str
);
}
else
if
(
SafeArrayPutElement
(
ret
,
&
i
,
ptr
)
!=
S_OK
)
{
...
...
@@ -1002,6 +1003,7 @@ HRESULT get_properties( const struct view *view, LONG flags, SAFEARRAY **props )
SafeArrayDestroy
(
sa
);
return
E_OUTOFMEMORY
;
}
SysFreeString
(
str
);
j
++
;
}
*
props
=
sa
;
...
...
dlls/wbemprox/reg.c
View file @
84a8ae79
...
...
@@ -51,6 +51,12 @@ static HRESULT to_bstr_array( BSTR *strings, DWORD count, VARIANT *var )
return
S_OK
;
}
static
void
free_bstr_array
(
BSTR
*
strings
,
DWORD
count
)
{
while
(
count
--
)
SysFreeString
(
*
(
strings
++
)
);
}
static
HRESULT
to_i4_array
(
DWORD
*
values
,
DWORD
count
,
VARIANT
*
var
)
{
SAFEARRAY
*
sa
;
...
...
@@ -114,7 +120,11 @@ static HRESULT enum_key( HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT
}
i
++
;
}
if
(
hr
==
S_OK
&&
!
res
)
hr
=
to_bstr_array
(
strings
,
i
,
names
);
if
(
hr
==
S_OK
&&
!
res
)
{
hr
=
to_bstr_array
(
strings
,
i
,
names
);
free_bstr_array
(
strings
,
i
);
}
set_variant
(
VT_UI4
,
res
,
NULL
,
retval
);
RegCloseKey
(
hkey
);
heap_free
(
strings
);
...
...
@@ -218,6 +228,7 @@ static HRESULT enum_values( HKEY root, const WCHAR *subkey, VARIANT *names, VARI
if
(
hr
==
S_OK
&&
!
res
)
{
hr
=
to_bstr_array
(
value_names
,
i
,
names
);
free_bstr_array
(
value_names
,
i
);
if
(
hr
==
S_OK
)
hr
=
to_i4_array
(
value_types
,
i
,
types
);
}
...
...
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