Skip to content

Commit

Permalink
FUSE - Fix unsafe nullptr mountpoint free
Browse files Browse the repository at this point in the history
#fixes 1162
  • Loading branch information
Liryna committed Nov 19, 2023
1 parent d715188 commit fbf335d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dokan_fuse/src/fuse_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int fuse_parse_cmdline(struct fuse_args *args, char **mountpoint,
if (mountpoint)
*mountpoint = hopts.mountpoint;
else
free(hopts.mountpoint);
goto err;

if (multithreaded)
*multithreaded = !hopts.singlethread;
Expand All @@ -177,7 +177,8 @@ int fuse_parse_cmdline(struct fuse_args *args, char **mountpoint,
return 0;

err:
free(hopts.mountpoint);
if (hopts.mountpoint)
free(hopts.mountpoint);
return -1;
}

Expand Down

0 comments on commit fbf335d

Please sign in to comment.