Skip to content

Commit

Permalink
Join command mem leak fix ##cmd (#15244)
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored and radare committed Oct 10, 2019
1 parent d561a59 commit 95afa19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libr/core/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ static int cmd_ls(void *data, const char *input) { // "ls"

static int cmd_join(void *data, const char *input) { // "join"
RCore *core = (RCore *)data;
const char *tmp = strdup (input);
char *tmp = strdup (input);
const char *arg1 = strchr (tmp, ' ');
if (!arg1) {
goto beach;
Expand Down Expand Up @@ -1092,13 +1092,14 @@ static int cmd_join(void *data, const char *input) { // "join"
r_cons_print (res);
free (res);
}
R_FREE (tmp);
}
break;
}
free (tmp);
return 0;
beach:
eprintf ("Usage: join [file1] [file2] # join the contents of the two files\n");
free (tmp);
return 0;
}

Expand Down

0 comments on commit 95afa19

Please sign in to comment.