aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-05-21 19:40:00 -0700
committerGuy Harris <gharris@sonic.net>2021-05-22 02:57:49 +0000
commitd072335658c7a466a1934862d5872664e64afc03 (patch)
tree3e8332603e69b1c44891255e99bf224ca4dbc02e
parent0e6c7c7bb2bf2320ea95567cfc6cb56aab397920 (diff)
fuzzshark: close a leak.
If init_progfile_dir() fails, it returns a g_mallocated string with an error message. After printing the error message, free the string. (cherry picked from commit c22b857942ea3f123d9fa5c31e04e85c6f3928f5)
-rw-r--r--fuzz/fuzzshark.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fuzz/fuzzshark.c b/fuzz/fuzzshark.c
index d9287823ac..1daf96247b 100644
--- a/fuzz/fuzzshark.c
+++ b/fuzz/fuzzshark.c
@@ -266,8 +266,10 @@ fuzz_init(int argc _U_, char **argv)
* Attempt to get the pathname of the executable file.
*/
init_progfile_dir_error = init_progfile_dir(argv[0]);
- if (init_progfile_dir_error != NULL)
+ if (init_progfile_dir_error != NULL) {
fprintf(stderr, "fuzzshark: Can't get pathname of oss-fuzzshark program: %s.\n", init_progfile_dir_error);
+ g_free(init_progfile_dir_error);
+ }
/* Initialize the version information. */
ws_init_version_info("OSS Fuzzshark (Wireshark)", NULL,