From e1d3a641a40de88ab3cff620fbcbfad9a3384518 Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Wed, 30 Apr 2014 04:24:58 +0400 Subject: [PATCH] Fix CID 1135013 --- libr/fs/fs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libr/fs/fs.c b/libr/fs/fs.c index e666d78df7..b394b0d8f7 100644 --- a/libr/fs/fs.c +++ b/libr/fs/fs.c @@ -90,6 +90,7 @@ R_API RFSRoot *r_fs_mount (RFS* fs, const char *fstype, const char *path, ut64 d else if (len > lenstr && root->path[lenstr] == '/') continue; eprintf ("r_fs_mount: Invalid mount point\n"); + free (str); return NULL; } } @@ -97,12 +98,14 @@ R_API RFSRoot *r_fs_mount (RFS* fs, const char *fstype, const char *path, ut64 d if (file) { r_fs_close (fs, file); eprintf ("r_fs_mount: Invalid mount point\n"); + free (str); return NULL; } else { list = r_fs_dir (fs, str); if (!r_list_empty (list)) { //XXX: list need free ?? eprintf ("r_fs_mount: Invalid mount point\n"); + free (str); return NULL; } }