diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-09-10 01:25:55 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-09-10 13:00:13 +0000 |
commit | 4b05159dfec9e3e4495982e70803d7d49c13f54b (patch) | |
tree | 6ff3466de5ae057b9a36859b81ea94f2f8497504 /capinfos.c | |
parent | d1a82132a62bbd5c20e0490c6f7d693c318481d1 (diff) |
capinfos: fix memleaks
Change-Id: Ib3145bb13d2a72c16f9c219fa19321e44958a30e
Reviewed-on: https://code.wireshark.org/review/17622
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'capinfos.c')
-rw-r--r-- | capinfos.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/capinfos.c b/capinfos.c index 9d0901da4d..beef85ecc0 100644 --- a/capinfos.c +++ b/capinfos.c @@ -1443,6 +1443,8 @@ main(int argc, char *argv[]) "\n" "%s", get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str); + g_string_free(comp_info_str, TRUE); + g_string_free(runtime_info_str, TRUE); #ifdef _WIN32 arg_list_utf_16to8(argc, argv); @@ -1642,6 +1644,8 @@ main(int argc, char *argv[]) break; case 'v': + comp_info_str = get_compiled_version_info(NULL, NULL); + runtime_info_str = get_runtime_version_info(NULL); show_version("Capinfos (Wireshark)", comp_info_str, runtime_info_str); g_string_free(comp_info_str, TRUE); g_string_free(runtime_info_str, TRUE); @@ -1712,7 +1716,7 @@ main(int argc, char *argv[]) } overall_error_status = 1; /* remember that an error has occurred */ if (!continue_after_wtap_open_offline_failure) - exit(1); /* error status */ + goto exit; } if (wth) { @@ -1721,11 +1725,17 @@ main(int argc, char *argv[]) status = process_cap_file(wth, argv[opt]); wtap_close(wth); - if (status) - exit(status); + if (status) { + overall_error_status = status; + goto exit; + } } } +exit: +#ifdef HAVE_LIBGCRYPT + g_free(hash_buf); +#endif return overall_error_status; } |