Skip to content

Commit

Permalink
Fix null deref, memleaks and portability regression
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Jun 26, 2024
1 parent 2be3f7e commit c13ede0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions libr/cons/hud.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ static char *r_cons_message_multiline(const char *msg) {
r_cons_any_key (NULL);
r_list_free (lines);
free (s);
free (newmsg);
return NULL;
}

Expand Down
4 changes: 2 additions & 2 deletions libr/core/panels.c
Original file line number Diff line number Diff line change
Expand Up @@ -5159,15 +5159,15 @@ static void __add_menu(RCore *core, const char *parent, const char *name, RPanel
}
if (p_item == NULL) {
R_LOG_WARN ("Cannot find panel %s", parent);
sleep (1);
r_sys_sleep (1);
}
item->n_sub = 0;
item->selectedIndex = 0;
item->name = name ? r_str_new (name) : NULL;
item->sub = NULL;
item->cb = cb;
item->p = R_NEW0 (RPanel);
if (item->p) {
if (item->p && p_item) {
item->p->model = R_NEW0 (RPanelModel);
item->p->view = R_NEW0 (RPanelView);
if (item->p->model && item->p->view) {
Expand Down
6 changes: 3 additions & 3 deletions libr/util/token.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ bool callback(RTokenizer *tok) {
switch (tok->ch) {
case '}':
R_FREE (data->s);
// pj_end (data->pj);
pj_end (data->pj);
pj_end (data->pj);
break;
}
Expand Down Expand Up @@ -337,7 +337,7 @@ bool callback(RTokenizer *tok) {
pj_end (data->pj);
if (first) {
first = false;
pj_ka (data->pj, "blocks");
pj_ka (data->pj, "body");
}
}
}
Expand All @@ -354,7 +354,7 @@ bool callback(RTokenizer *tok) {
R_FREE (data->s);
}
// pj_ka (data->pj, "body");
pj_a (data->pj);
//pj_a (data->pj);
} else if (tok->ch == '(') {
data->parlevel++;
if (data->word) {
Expand Down
2 changes: 1 addition & 1 deletion test/db/tools/token
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ EXPECT=<<EOF
}
],
"body": [
{
"args": {
"type": "call",
"name": "puts",
"args": [
Expand Down

0 comments on commit c13ede0

Please sign in to comment.