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
85afcdbf
Commit
85afcdbf
authored
Jan 26, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Fix the mem handling in get_attr() (Smatch).
name_buf is allocated on the stack and node_buf by heap_alloc. Also don't leak node_buf when leaving the function.
parent
69861cf8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
content.c
dlls/hhctrl.ocx/content.c
+6
-4
No files found.
dlls/hhctrl.ocx/content.c
View file @
85afcdbf
...
...
@@ -186,7 +186,7 @@ static const char *get_attr(const char *node, const char *name, int *len)
ptr
=
strstr
(
node_buf
,
name_buf
);
if
(
!
ptr
)
{
WARN
(
"name not found
\n
"
);
heap_free
(
n
am
e_buf
);
heap_free
(
n
od
e_buf
);
return
NULL
;
}
...
...
@@ -194,14 +194,16 @@ static const char *get_attr(const char *node, const char *name, int *len)
ptr2
=
strchr
(
ptr
,
'\"'
);
if
(
!
ptr2
)
{
heap_free
(
n
am
e_buf
);
heap_free
(
n
od
e_buf
);
return
NULL
;
}
*
len
=
ptr2
-
ptr
;
heap_free
(
name_buf
);
/* Return the pointer offset within the original string */
return
node
+
(
ptr
-
node_buf
);
ptr
=
node
+
(
ptr
-
node_buf
);
heap_free
(
node_buf
);
return
ptr
;
}
static
void
parse_obj_node_param
(
ContentItem
*
item
,
ContentItem
*
hhc_root
,
const
char
*
text
)
...
...
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