diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2018-01-24 03:41:12 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2018-01-28 21:49:42 +0000 |
commit | 3d94f624d152068cd597e139d5807357fa285ac6 (patch) | |
tree | fd2234d1726a2ba1b71a2d02d39d6aa6024a3e3a | |
parent | 1b467b11add2fdf7a40bb86ffb78b63a28b27f87 (diff) |
wsutil/filesystem.c: fix memory leak in init_progfile_dir()
If file wasn't found in PATH, there is a leak of path.
Don't break the loop after reaching NUL character.
Check for NUL character will be done in while() start condition.
Found by clang.
Change-Id: I0111a71853ffd485ee1096296f92de4472409c66
Reviewed-on: https://code.wireshark.org/review/25445
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | wsutil/filesystem.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index b78f8c9080..ee41489894 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -638,12 +638,6 @@ DIAG_ON(pedantic) * That's not it. If there are more * path components to test, try them. */ - if (*path_end == '\0') { - /* - * There's nothing more to try. - */ - break; - } if (*path_end == ':') path_end++; path_start = path_end; |