summaryrefslogtreecommitdiff
path: root/ui/voip_calls.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-10-25 19:24:06 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2015-10-26 11:06:51 +0000
commite2203f5aed1eef900c7568b6d14f3e303e271b7c (patch)
treeacdb69aa22bab5ee178d3713d2cbfcf82557f0bb /ui/voip_calls.c
parent5dffa81e8cc45dfefb974768e90533097ecee996 (diff)
downloadwireshark-e2203f5aed1eef900c7568b6d14f3e303e271b7c.tar.gz
Qt: fix memory leaks in VoIP calls window
- Add free of h245_labels to voip_calls_remove_all_tap_listeners() so that memory is not leaked with Qt GUI - Call voip_calls_reset_all_taps() from VoipCallsDialog destructor so as to free allocated memory Change-Id: I46945b5d475d8c1267819021a4ed2782c531a0c6 Reviewed-on: https://code.wireshark.org/review/11268 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'ui/voip_calls.c')
-rw-r--r--ui/voip_calls.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/voip_calls.c b/ui/voip_calls.c
index 17643d796f..fff48ef5c6 100644
--- a/ui/voip_calls.c
+++ b/ui/voip_calls.c
@@ -290,13 +290,7 @@ voip_calls_reset_all_taps(voip_calls_tapinfo_t *tapinfo)
g_list_free(tapinfo->rtp_stream_list);
tapinfo->rtp_stream_list = NULL;
- if (!tapinfo->h245_labels) {
- /*
- * XXX - given that we set this in fff, will this ever be
- * the case?
- */
- tapinfo->h245_labels = g_new0(h245_labels_t, 1);
- } else {
+ if (tapinfo->h245_labels) {
memset(tapinfo->h245_labels, 0, sizeof(h245_labels_t));
}
@@ -2222,7 +2216,9 @@ h245dg_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
{
GString *error_string;
- tap_id_base->h245_labels = g_new0(h245_labels_t, 1);
+ if (!tap_id_base->h245_labels) {
+ tap_id_base->h245_labels = g_new0(h245_labels_t, 1);
+ }
error_string = register_tap_listener("h245dg", tap_base_to_id(tap_id_base, tap_id_offset_h245dg_), NULL,
0,
@@ -2242,6 +2238,10 @@ h245dg_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
void
remove_tap_listener_h245dg_calls(voip_calls_tapinfo_t *tap_id_base)
{
+ if (tap_id_base->h245_labels) {
+ g_free(tap_id_base->h245_labels);
+ tap_id_base->h245_labels = NULL;
+ }
remove_tap_listener(tap_base_to_id(tap_id_base, tap_id_offset_h245dg_));
}