Skip to content

Commit

Permalink
Fix recent memleaks found by cov
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 25, 2017
1 parent cd8e103 commit 2eb8af0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libr/fs/p/fs_r2.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ static RList *fscmd(RFSRoot *root, const char *cmd, int type) {
}
int i, count = 0;
int *lines = r_str_split_lines (res, &count);
for (i = 0; i < count; i++) {
char *line = strdup (res + lines[i]);
append_file (list, line, type, 0, 0);
if (lines) {
for (i = 0; i < count; i++) {
append_file (list, res + lines[i], type, 0, 0);
}
free (lines);
}
free (res);
return list;
Expand Down

0 comments on commit 2eb8af0

Please sign in to comment.