mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-26 09:06:02 +00:00
Fix a memory leak in libr/util/stack.c
This commit is contained in:
parent
e4cce06671
commit
3c79dbc019
@ -27,9 +27,9 @@ R_API RStack *r_stack_newf(ut32 n, RStackFree f) {
|
||||
|
||||
R_API void r_stack_free(RStack *s) {
|
||||
if (s) {
|
||||
if (s->free && s->top > 0) {
|
||||
int i = 0;
|
||||
for (i = 0; i < s->top; i++) {
|
||||
if (s->free) {
|
||||
int i;
|
||||
for (i = 0; i <= s->top; i++) {
|
||||
s->free (s->elems[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user