aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-01-19 14:24:31 +0100
committerMichael Mann <mmann78@netscape.net>2018-01-29 00:04:13 +0000
commitbc36e2a113112c7ee1abe9044347237c626a2161 (patch)
tree3f0e3e3cdf94310f0aac016c37fcaefced1f9503
parent907d8ff41f37f8eaed5e4c64ab322f33ea2c6802 (diff)
cli: free memory on exit in tap-comparestat (found by clang).
Change-Id: Ie4dfc68583fa6fc742baeaf9d9fd1c7d2f783f38 Reviewed-on: https://code.wireshark.org/review/25435 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--ui/cli/tap-comparestat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/cli/tap-comparestat.c b/ui/cli/tap-comparestat.c
index 4d826da89e..5adb6de360 100644
--- a/ui/cli/tap-comparestat.c
+++ b/ui/cli/tap-comparestat.c
@@ -232,12 +232,15 @@ call_foreach_count_ip_id(gpointer key _U_, gpointer value, gpointer arg)
/* collect TTL's */
if (TTL_method && (fInfo->num < TTL_SEARCH)) {
+ gboolean found = FALSE;
for (i=0; i < cs->ip_ttl_list->len; i++) {
if (g_array_index(cs->ip_ttl_list, guint8, i) == fInfo->ip_ttl) {
- return;
+ found = TRUE;
+ break;
}
}
- g_array_append_val(cs->ip_ttl_list, fInfo->ip_ttl);
+ if (!found)
+ g_array_prepend_val(cs->ip_ttl_list, fInfo->ip_ttl);
}
g_free(pinfo->fd);