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
34a0463b
Commit
34a0463b
authored
Mar 14, 2005
by
Joris Huizer
Committed by
Alexandre Julliard
Mar 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few memory checks avoiding memory leaks.
parent
ba5eb147
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
clipboard.c
dlls/ole32/clipboard.c
+11
-4
No files found.
dlls/ole32/clipboard.c
View file @
34a0463b
...
...
@@ -938,12 +938,15 @@ static HRESULT OLEClipbrd_RenderFormat(IDataObject *pIDataObject, LPFORMATETC pF
std
.
tymed
=
pFormatetc
->
tymed
=
TYMED_ISTORAGE
;
hStorage
=
GlobalAlloc
(
GMEM_SHARE
|
GMEM_MOVEABLE
,
0
);
if
(
hStorage
==
NULL
)
HANDLE_ERROR
(
E_OUTOFMEMORY
);
hr
=
CreateILockBytesOnHGlobal
(
hStorage
,
FALSE
,
&
ptrILockBytes
);
hr
=
StgCreateDocfileOnILockBytes
(
ptrILockBytes
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
std
.
u
.
pstg
);
if
(
FAILED
(
hr
=
IDataObject_GetDataHere
(
theOleClipboard
->
pIDataObjectSrc
,
pFormatetc
,
&
std
)))
{
WARN
(
"() : IDataObject_GetDataHere failed to render clipboard data! (%lx)
\n
"
,
hr
);
GlobalFree
(
hStorage
);
return
hr
;
}
...
...
@@ -1023,10 +1026,11 @@ static HRESULT OLEClipbrd_RenderFormat(IDataObject *pIDataObject, LPFORMATETC pF
else
{
if
(
FAILED
(
hr
=
IDataObject_GetData
(
pIDataObject
,
pFormatetc
,
&
std
)))
{
WARN
(
"() : IDataObject_GetData failed to render clipboard data! (%lx)
\n
"
,
hr
);
return
hr
;
}
{
WARN
(
"() : IDataObject_GetData failed to render clipboard data! (%lx)
\n
"
,
hr
);
GlobalFree
(
hStorage
);
return
hr
;
}
/* To put a copy back on the clipboard */
...
...
@@ -1079,7 +1083,10 @@ static HGLOBAL OLEClipbrd_GlobalDupMem( HGLOBAL hGlobalSrc )
pGlobalSrc
=
GlobalLock
(
hGlobalSrc
);
pGlobalDest
=
GlobalLock
(
hGlobalDest
);
if
(
!
pGlobalSrc
||
!
pGlobalDest
)
{
GlobalFree
(
hGlobalDest
);
return
0
;
}
memcpy
(
pGlobalDest
,
pGlobalSrc
,
cBytes
);
...
...
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