Fix Leak in r_cons_pop() (#10322)

This commit is contained in:
Florian Märkl 2018-06-11 18:49:10 +02:00 committed by radare
parent 35f6c776e8
commit 6fa6ce3efb

View File

@ -541,12 +541,8 @@ R_API void r_cons_pop() {
memcpy (I.buffer, data->buf, data->buf_size);
}
if (data->grep) {
free (I.grep.str);
memcpy (&I.grep, data->grep, sizeof (RConsGrep));
if (data->grep->str) {
char *old = I.grep.str;
I.grep.str = strdup (data->grep->str);
R_FREE (old);
}
}
cons_stack_free ((void *)data);
}