Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xin Wang
codes-dev
Commits
7a7a9070
Commit
7a7a9070
authored
Jun 23, 2015
by
Jonathan Jenkins
Browse files
fix mem leak in rc stack
parent
ed014c3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/util/rc-stack.c
View file @
7a7a9070
...
...
@@ -63,12 +63,17 @@ void rc_stack_push(
}
void
*
rc_stack_pop
(
struct
rc_stack
*
s
){
void
*
ret
=
NULL
;
rc_entry
*
ent
=
NULL
;
struct
qlist_head
*
item
=
qlist_pop_back
(
&
s
->
head
);
if
(
item
==
NULL
)
tw_error
(
TW_LOC
,
"could not pop item from rc stack (stack likely empty)
\n
"
);
s
->
count
--
;
return
qlist_entry
(
item
,
rc_entry
,
ql
)
->
data
;
ent
=
qlist_entry
(
item
,
rc_entry
,
ql
);
ret
=
ent
->
data
;
free
(
ent
);
return
ret
;
}
int
rc_stack_count
(
struct
rc_stack
*
s
)
{
return
s
->
count
;
}
...
...
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