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
96b0bdc3
Commit
96b0bdc3
authored
Oct 29, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Don't release a NULL interface in VARIANT_UserFree().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5c8329d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
usrmarshal.c
dlls/oleaut32/tests/usrmarshal.c
+27
-0
usrmarshal.c
dlls/oleaut32/usrmarshal.c
+2
-1
No files found.
dlls/oleaut32/tests/usrmarshal.c
View file @
96b0bdc3
...
...
@@ -777,6 +777,7 @@ static void test_marshal_VARIANT(void)
HRESULT
hr
;
LONG
bound
,
bound2
;
VARTYPE
vt
,
vt2
;
IUnknown
*
unk
;
stubMsg
.
RpcMsg
=
&
rpcMsg
;
...
...
@@ -1579,6 +1580,32 @@ todo_wine
ok
(
heap_unknown
->
refs
==
1
,
"%d refcounts of IUnknown leaked
\n
"
,
heap_unknown
->
refs
-
1
);
IUnknown_Release
(
&
heap_unknown
->
IUnknown_iface
);
HeapFree
(
GetProcessHeap
(),
0
,
oldbuffer
);
unk
=
NULL
;
VariantInit
(
&
v
);
V_VT
(
&
v
)
=
VT_UNKNOWN
|
VT_BYREF
;
V_UNKNOWNREF
(
&
v
)
=
&
unk
;
rpcMsg
.
BufferLength
=
stubMsg
.
BufferLength
=
VARIANT_UserSize
(
&
umcb
.
Flags
,
0
,
&
v
);
ok
(
stubMsg
.
BufferLength
>=
28
,
"size %d
\n
"
,
stubMsg
.
BufferLength
);
buffer
=
rpcMsg
.
Buffer
=
stubMsg
.
Buffer
=
stubMsg
.
BufferStart
=
alloc_aligned
(
stubMsg
.
BufferLength
,
&
oldbuffer
);
stubMsg
.
BufferEnd
=
stubMsg
.
Buffer
+
stubMsg
.
BufferLength
;
memset
(
buffer
,
0xcc
,
stubMsg
.
BufferLength
);
next
=
VARIANT_UserMarshal
(
&
umcb
.
Flags
,
buffer
,
&
v
);
ok
(
next
==
buffer
+
stubMsg
.
BufferLength
,
"got %p expect %p
\n
"
,
next
,
buffer
+
stubMsg
.
BufferLength
);
wirev
=
(
DWORD
*
)
buffer
;
wirev
=
check_variant_header
(
wirev
,
&
v
,
stubMsg
.
BufferLength
);
ok
(
*
wirev
==
4
,
"wv[5] %08x
\n
"
,
*
wirev
);
VariantInit
(
&
v2
);
stubMsg
.
Buffer
=
buffer
;
next
=
VARIANT_UserUnmarshal
(
&
umcb
.
Flags
,
buffer
,
&
v2
);
ok
(
next
==
buffer
+
stubMsg
.
BufferLength
,
"got %p expect %p
\n
"
,
next
,
buffer
+
stubMsg
.
BufferLength
);
ok
(
V_VT
(
&
v
)
==
V_VT
(
&
v2
),
"got vt %d expect %d
\n
"
,
V_VT
(
&
v2
),
V_VT
(
&
v
));
ok
(
!*
V_UNKNOWNREF
(
&
v2
),
"got %p expect NULL
\n
"
,
*
V_UNKNOWNREF
(
&
v2
));
VARIANT_UserFree
(
&
umcb
.
Flags
,
&
v2
);
HeapFree
(
GetProcessHeap
(),
0
,
oldbuffer
);
}
...
...
dlls/oleaut32/usrmarshal.c
View file @
96b0bdc3
...
...
@@ -647,7 +647,8 @@ void WINAPI VARIANT_UserFree(ULONG *pFlags, VARIANT *pvar)
break
;
case
VT_UNKNOWN
|
VT_BYREF
:
case
VT_DISPATCH
|
VT_BYREF
:
IUnknown_Release
(
*
V_UNKNOWNREF
(
pvar
));
if
(
*
V_UNKNOWNREF
(
pvar
))
IUnknown_Release
(
*
V_UNKNOWNREF
(
pvar
));
break
;
}
}
...
...
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