diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-12-18 23:13:02 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-12-19 07:13:38 +0000 |
commit | 0fc7f3781351c23cf05bdaafc1dd3dc6f9a08a2c (patch) | |
tree | 8ba20598e16aa6df685da53e5336f097e50d4f3f | |
parent | 05b43fc5af805dde1bdbf74dd1448690f3a10705 (diff) |
Don't free something before freeing some of its contents.
Free the wspstat_t only after freeing the hash table contained in it.
Change-Id: I2aa31d74b6d0f86e5404a9b614fee8a3f6708938
Ping-Bug: 15365
Reviewed-on: https://code.wireshark.org/review/31108
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | ui/cli/tap-wspstat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/cli/tap-wspstat.c b/ui/cli/tap-wspstat.c index 22862cdaf8..fd6f3ad427 100644 --- a/ui/cli/tap-wspstat.c +++ b/ui/cli/tap-wspstat.c @@ -252,9 +252,9 @@ wspstat_init(const char *opt_arg, void *userdata _U_) /* error, we failed to attach to the tap. clean up */ g_free(sp->pdu_stats); g_free(sp->filter); - g_free(sp); g_hash_table_foreach( sp->hash, (GHFunc) wsp_free_hash_table, NULL ) ; g_hash_table_destroy( sp->hash ); + g_free(sp); fprintf(stderr, "tshark: Couldn't register wsp,stat tap: %s\n", error_string->str); g_string_free(error_string, TRUE); |