Minor fixes/cleanups (#12388)

This commit is contained in:
dav1901 2018-12-04 00:32:08 +02:00 committed by radare
parent b453df6acc
commit 2f0f89693f
4 changed files with 7 additions and 3 deletions

View File

@ -650,6 +650,7 @@ static int cmd_type(void *data, const char *input) {
case 'j':
if (input[2]) {
showFormat (core, r_str_trim_ro (input + 2), 'j');
r_cons_newline ();
} else {
print_keys (TDB, core, stdifunion, printkey_json_cb, true);
}

View File

@ -3114,7 +3114,7 @@ static void agraph_follow_false(RAGraph *g) {
/* seek the next node in visual order */
static void agraph_next_node(RAGraph *g) {
RANode *a = get_anode (find_near_of (g, g->curnode, true));
while (a->is_dummy) {
while (a && a->is_dummy) {
a = get_anode (find_near_of (g, a->gnode, true));
}
r_agraph_set_curnode (g, a);
@ -3124,7 +3124,7 @@ static void agraph_next_node(RAGraph *g) {
/* seek the previous node in visual order */
static void agraph_prev_node(RAGraph *g) {
RANode *a = get_anode (find_near_of (g, g->curnode, false));
while (a->is_dummy) {
while (a && a->is_dummy) {
a = get_anode (find_near_of (g, a->gnode, false));
}
r_agraph_set_curnode (g, a);

View File

@ -1900,7 +1900,8 @@ static void visual_closetab (RCore *core) {
core->visual.tab = 1;
}
visual_nexttab (core);
RCoreVisualTab *tab = r_list_head (core->visual.tabs)->data;
RListIter *head = r_list_head (core->visual.tabs);
RCoreVisualTab *tab = head ? head->data : NULL;
if (tab) {
r_core_seek (core, tab->offset, 1);
core->printidx = tab->printidx;

View File

@ -188,6 +188,8 @@ static RIODesc *rap__open(RIO *io, const char *pathname, int rw, int mode) {
}
} else {
if (!r_socket_listen (rior->fd, port, NULL)) {
r_socket_free (rior->fd);
free (rior);
return NULL;
}
}