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
a5755b10
Commit
a5755b10
authored
Jun 13, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authors: Mike McCormack <mikem@codeweavers.com>, Jeremy White <jwhite@codeweavers.com>
Fixed memory leaks.
parent
bf2c7efa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
21 deletions
+37
-21
storage.c
dlls/ole32/storage.c
+26
-16
queue.c
dlls/setupapi/queue.c
+5
-2
lstr.c
dlls/user/lstr.c
+1
-0
winpos.c
dlls/x11drv/winpos.c
+1
-0
path.c
graphics/path.c
+4
-3
No files found.
dlls/ole32/storage.c
View file @
a5755b10
...
...
@@ -885,6 +885,8 @@ HRESULT WINAPI IStream16_fnWrite(
* (we just migrate newsize bytes)
*/
LPBYTE
curdata
,
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
newsize
+
BIGSIZE
);
HRESULT
r
=
E_FAIL
;
cc
=
newsize
;
blocknr
=
This
->
stde
.
pps_sb
;
curdata
=
data
;
...
...
@@ -899,31 +901,35 @@ HRESULT WINAPI IStream16_fnWrite(
}
/* frees complete chain for this stream */
if
(
!
STORAGE_set_big_chain
(
hf
,
This
->
stde
.
pps_sb
,
STORAGE_CHAINENTRY_FREE
))
return
E_FAIL
;
goto
err
;
curdata
=
data
;
blocknr
=
This
->
stde
.
pps_sb
=
STORAGE_get_free_small_blocknr
(
hf
);
if
(
blocknr
<
0
)
return
E_FAIL
;
goto
err
;
cc
=
newsize
;
while
(
cc
>
0
)
{
if
(
!
STORAGE_put_small_block
(
hf
,
blocknr
,
curdata
))
return
E_FAIL
;
goto
err
;
cc
-=
SMALLSIZE
;
if
(
cc
<=
0
)
{
if
(
!
STORAGE_set_small_chain
(
hf
,
blocknr
,
STORAGE_CHAINENTRY_ENDOFCHAIN
))
return
E_FAIL
;
goto
err
;
break
;
}
else
{
int
newblocknr
=
STORAGE_get_free_small_blocknr
(
hf
);
if
(
newblocknr
<
0
)
return
E_FAIL
;
goto
err
;
if
(
!
STORAGE_set_small_chain
(
hf
,
blocknr
,
newblocknr
))
return
E_FAIL
;
goto
err
;
blocknr
=
newblocknr
;
}
curdata
+=
SMALLSIZE
;
}
r
=
S_OK
;
err:
HeapFree
(
GetProcessHeap
(),
0
,
data
);
if
(
r
!=
S_OK
)
return
r
;
}
}
This
->
stde
.
pps_size
=
newsize
;
...
...
@@ -978,47 +984,51 @@ HRESULT WINAPI IStream16_fnWrite(
}
else
{
/* Migrate small blocks to big blocks */
LPBYTE
curdata
,
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
oldsize
+
BIGSIZE
);
HRESULT
r
=
E_FAIL
;
cc
=
oldsize
;
blocknr
=
This
->
stde
.
pps_sb
;
curdata
=
data
;
/* slurp in */
while
(
cc
>
0
)
{
if
(
!
STORAGE_get_small_block
(
hf
,
blocknr
,
curdata
))
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
E_FAIL
;
}
if
(
!
STORAGE_get_small_block
(
hf
,
blocknr
,
curdata
))
goto
err2
;
curdata
+=
SMALLSIZE
;
cc
-=
SMALLSIZE
;
blocknr
=
STORAGE_get_next_small_blocknr
(
hf
,
blocknr
);
}
/* free small block chain */
if
(
!
STORAGE_set_small_chain
(
hf
,
This
->
stde
.
pps_sb
,
STORAGE_CHAINENTRY_FREE
))
return
E_FAIL
;
goto
err2
;
curdata
=
data
;
blocknr
=
This
->
stde
.
pps_sb
=
STORAGE_get_free_big_blocknr
(
hf
);
if
(
blocknr
<
0
)
return
E_FAIL
;
goto
err2
;
/* put the data into the big blocks */
cc
=
This
->
stde
.
pps_size
;
while
(
cc
>
0
)
{
if
(
!
STORAGE_put_big_block
(
hf
,
blocknr
,
curdata
))
return
E_FAIL
;
goto
err2
;
cc
-=
BIGSIZE
;
if
(
cc
<=
0
)
{
if
(
!
STORAGE_set_big_chain
(
hf
,
blocknr
,
STORAGE_CHAINENTRY_ENDOFCHAIN
))
return
E_FAIL
;
goto
err2
;
break
;
}
else
{
int
newblocknr
=
STORAGE_get_free_big_blocknr
(
hf
);
if
(
newblocknr
<
0
)
return
E_FAIL
;
goto
err2
;
if
(
!
STORAGE_set_big_chain
(
hf
,
blocknr
,
newblocknr
))
return
E_FAIL
;
goto
err2
;
blocknr
=
newblocknr
;
}
curdata
+=
BIGSIZE
;
}
r
=
S_OK
;
err2:
HeapFree
(
GetProcessHeap
(),
0
,
data
);
if
(
r
!=
S_OK
)
return
r
;
}
/* generate big blocks to fit the new data */
lastblocknr
=
blocknr
;
...
...
dlls/setupapi/queue.c
View file @
a5755b10
...
...
@@ -115,9 +115,9 @@ inline static void queue_file_op( struct file_op_queue *queue, struct file_op *o
/* free all the file operations on a given queue */
static
void
free_file_op_queue
(
struct
file_op_queue
*
queue
)
{
struct
file_op
*
op
;
struct
file_op
*
t
,
*
op
=
queue
->
head
;
for
(
op
=
queue
->
head
;
op
;
op
=
op
->
next
)
while
(
op
)
{
HeapFree
(
GetProcessHeap
(),
0
,
op
->
src_root
);
HeapFree
(
GetProcessHeap
(),
0
,
op
->
src_path
);
...
...
@@ -126,6 +126,9 @@ static void free_file_op_queue( struct file_op_queue *queue )
HeapFree
(
GetProcessHeap
(),
0
,
op
->
src_tag
);
HeapFree
(
GetProcessHeap
(),
0
,
op
->
dst_path
);
if
(
op
->
dst_file
!=
op
->
src_file
)
HeapFree
(
GetProcessHeap
(),
0
,
op
->
dst_file
);
t
=
op
;
op
=
op
->
next
;
HeapFree
(
GetProcessHeap
(),
0
,
t
);
}
}
...
...
dlls/user/lstr.c
View file @
a5755b10
...
...
@@ -711,6 +711,7 @@ DWORD WINAPI FormatMessage16(
b
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
b
,
sz
);
}
for
(
x
=
b
;
*
x
;
x
++
)
ADD_TO_T
(
*
x
);
HeapFree
(
GetProcessHeap
(),
0
,
b
);
}
else
{
/* NULL args - copy formatstr
* (probably wrong)
...
...
dlls/x11drv/winpos.c
View file @
a5755b10
...
...
@@ -1053,6 +1053,7 @@ static POINT WINPOS_FindIconPos( WND* wndPtr, POINT pt )
/* No window was found, so it's OK for us */
pt
.
x
=
x
+
(
xspacing
-
GetSystemMetrics
(
SM_CXICON
))
/
2
;
pt
.
y
=
y
-
(
yspacing
+
GetSystemMetrics
(
SM_CYICON
))
/
2
;
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
pt
;
}
while
(
x
<=
rectParent
.
right
-
xspacing
);
...
...
graphics/path.c
View file @
a5755b10
...
...
@@ -1222,15 +1222,16 @@ static BOOL PATH_PathToRegion(GdiPath *pPath, INT nPolyFillMode,
/* Create a region from the strokes */
hrgn
=
CreatePolyPolygonRgn
(
pPath
->
pPoints
,
pNumPointsInStroke
,
numStrokes
,
nPolyFillMode
);
/* Free memory for number-of-points-in-stroke array */
HeapFree
(
GetProcessHeap
(),
0
,
pNumPointsInStroke
);
if
(
hrgn
==
(
HRGN
)
0
)
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
/* Free memory for number-of-points-in-stroke array */
HeapFree
(
GetProcessHeap
(),
0
,
pNumPointsInStroke
);
/* Success! */
*
pHrgn
=
hrgn
;
return
TRUE
;
...
...
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