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
76e8b504
Commit
76e8b504
authored
Nov 05, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Fixed memory leak in source string handling.
parent
a519d104
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
source.c
dlls/dbghelp/source.c
+16
-17
No files found.
dlls/dbghelp/source.c
View file @
76e8b504
...
...
@@ -56,7 +56,6 @@ static unsigned source_find(const struct module* module, const char* name)
*/
unsigned
source_new
(
struct
module
*
module
,
const
char
*
base
,
const
char
*
name
)
{
int
len
;
unsigned
ret
;
const
char
*
full
;
char
*
tmp
=
NULL
;
...
...
@@ -75,24 +74,24 @@ unsigned source_new(struct module* module, const char* base, const char* name)
if
(
tmp
[
bsz
-
1
]
!=
'/'
)
tmp
[
bsz
++
]
=
'/'
;
strcpy
(
&
tmp
[
bsz
],
name
);
}
if
(
module
->
sources
&&
(
ret
=
source_find
(
module
,
full
))
!=
(
unsigned
)
-
1
)
return
ret
;
len
=
strlen
(
full
)
+
1
;
if
(
module
->
sources_used
+
len
+
1
>
module
->
sources_alloc
)
if
(
!
module
->
sources
||
(
ret
=
source_find
(
module
,
full
))
==
(
unsigned
)
-
1
)
{
/* Alloc by block of 256 bytes */
module
->
sources_alloc
=
(
module
->
sources_used
+
len
+
1
+
255
)
&
~
255
;
if
(
!
module
->
sources
)
module
->
sources
=
HeapAlloc
(
GetProcessHeap
(),
0
,
module
->
sources_alloc
);
else
module
->
sources
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
module
->
sources
,
module
->
sources_alloc
);
int
len
=
strlen
(
full
)
+
1
;
if
(
module
->
sources_used
+
len
+
1
>
module
->
sources_alloc
)
{
/* Alloc by block of 256 bytes */
module
->
sources_alloc
=
(
module
->
sources_used
+
len
+
1
+
255
)
&
~
255
;
if
(
!
module
->
sources
)
module
->
sources
=
HeapAlloc
(
GetProcessHeap
(),
0
,
module
->
sources_alloc
);
else
module
->
sources
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
module
->
sources
,
module
->
sources_alloc
);
}
ret
=
module
->
sources_used
;
memcpy
(
module
->
sources
+
module
->
sources_used
,
full
,
len
);
module
->
sources_used
+=
len
;
module
->
sources
[
module
->
sources_used
]
=
'\0'
;
}
ret
=
module
->
sources_used
;
strcpy
(
module
->
sources
+
module
->
sources_used
,
full
);
module
->
sources_used
+=
len
;
module
->
sources
[
module
->
sources_used
]
=
'\0'
;
HeapFree
(
GetProcessHeap
(),
0
,
tmp
);
return
ret
;
}
...
...
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