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
25a66632
Commit
25a66632
authored
Mar 14, 2005
by
Peter Berg Larsen
Committed by
Alexandre Julliard
Mar 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assorted memleak fixes. Found on Michael Stefaniuc smatch list.
parent
dcab706f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
lstr.c
dlls/user/lstr.c
+2
-2
message.c
dlls/user/message.c
+16
-6
No files found.
dlls/user/lstr.c
View file @
25a66632
...
...
@@ -625,11 +625,11 @@ DWORD WINAPI FormatMessage16(
from
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
source
)
+
1
);
strcpy
(
from
,
source
);
}
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
{
else
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_SYSTEM
)
{
from
=
HeapAlloc
(
GetProcessHeap
(),
0
,
200
);
sprintf
(
from
,
"Systemmessage, messageid = 0x%08x
\n
"
,
dwMessageId
);
}
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
)
{
else
if
(
dwFlags
&
FORMAT_MESSAGE_FROM_HMODULE
)
{
INT16
bufsize
;
HINSTANCE16
hinst16
=
((
HINSTANCE16
)
lpSource
&
0xffff
);
...
...
dlls/user/message.c
View file @
25a66632
...
...
@@ -1435,13 +1435,18 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
TRACE
(
"recv ddepack %u %x
\n
"
,
size
,
uiHi
);
if
(
size
)
{
hMem
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
size
);
if
(
hMem
&&
(
ptr
=
GlobalLock
(
hMem
)))
if
(
!
(
hMem
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
size
)))
return
FALSE
;
if
((
ptr
=
GlobalLock
(
hMem
)))
{
memcpy
(
ptr
,
*
buffer
,
size
);
GlobalUnlock
(
hMem
);
}
else
return
FALSE
;
else
{
GlobalFree
(
hMem
);
return
FALSE
;
}
}
uiLo
=
(
UINT
)
hMem
;
...
...
@@ -1451,8 +1456,8 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
if
(
size
)
{
if
(
!
buffer
||
!*
buffer
)
return
FALSE
;
hMem
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
size
)
;
if
(
hMem
&&
(
ptr
=
GlobalLock
(
hMem
)))
if
(
!
(
hMem
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
size
)))
return
FALSE
;
if
(
(
ptr
=
GlobalLock
(
hMem
)))
{
memcpy
(
ptr
,
*
buffer
,
size
);
GlobalUnlock
(
hMem
);
...
...
@@ -1462,7 +1467,12 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
GlobalFree
(
hMem
);
return
FALSE
;
}
}
}
else
{
GlobalFree
(
hMem
);
return
FALSE
;
}
}
else
return
FALSE
;
*
lparam
=
(
LPARAM
)
hMem
;
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