diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-05-04 22:31:29 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-05-09 18:41:46 +0000 |
commit | 67ea8cb25fab11c4ac36393e4f184bee17bdf965 (patch) | |
tree | c1cf2925ffe444dad188ca958ac06f39e7cfd553 | |
parent | 5507a34d1f0d1f96b3dc5283cca0619b05853f89 (diff) |
ui/voip_calls: fix memleak in is_mgcp_signal
Change-Id: I91226fc88f6e200c0c45ff74cc4232521e602fd3
Reviewed-on: https://code.wireshark.org/review/27345
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | ui/voip_calls.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/voip_calls.c b/ui/voip_calls.c index 9be42b6e38..bc60c51980 100644 --- a/ui/voip_calls.c +++ b/ui/voip_calls.c @@ -2425,6 +2425,7 @@ is_mgcp_signal(const gchar *signal_str_p, const gchar *signalStr) { gint i; gchar **resultArray; + gboolean found = FALSE; /* if there is no signalStr, just return false */ if (signalStr == NULL) return FALSE; @@ -2437,12 +2438,15 @@ is_mgcp_signal(const gchar *signal_str_p, const gchar *signalStr) for (i = 0; resultArray[i]; i++) { g_strstrip(resultArray[i]); - if (strcmp(resultArray[i], signal_str_p) == 0) return TRUE; + if (strcmp(resultArray[i], signal_str_p) == 0) { + found = TRUE; + break; + } } g_strfreev(resultArray); - return FALSE; + return found; } /* |