diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-03-25 23:24:59 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-03-27 04:51:00 +0000 |
commit | 802223829e9899638557c4cf13a5a643d96a0385 (patch) | |
tree | 2899e282a67eebf55522b00870ac52d5b653de78 /ui/qt/wireless_timeline.cpp | |
parent | 3b042a717258e331f670bfc322e59d4b191a93db (diff) |
tap: fix remaining potential memleaks with register_tap_listener
Additionally, add an attribute to the tap function to prevent future
callers from leaking this memory.
Change-Id: Ief6af2bbc74d19153628f09d7b273e85cb2284ab
Reviewed-on: https://code.wireshark.org/review/26642
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/wireless_timeline.cpp')
-rw-r--r-- | ui/qt/wireless_timeline.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/qt/wireless_timeline.cpp b/ui/qt/wireless_timeline.cpp index d4c30d6132..59d084cdeb 100644 --- a/ui/qt/wireless_timeline.cpp +++ b/ui/qt/wireless_timeline.cpp @@ -31,7 +31,8 @@ #include <ui/qt/utils/color_utils.h> #include <ui/qt/utils/qt_ui_utils.h> #include "wireshark_application.h" -#include "wsutil/utf8_entities.h" +#include <wsutil/report_message.h> +#include <wsutil/utf8_entities.h> #ifdef Q_OS_WIN #include "wsutil/file_util.h" @@ -298,7 +299,12 @@ void WirelessTimeline::captureFileReadFinished() void WirelessTimeline::appInitialized() { - register_tap_listener("wlan_radio_timeline", this, NULL, TL_REQUIRES_NOTHING, tap_timeline_reset, tap_timeline_packet, NULL/*tap_draw_cb tap_draw*/); + GString *error_string; + error_string = register_tap_listener("wlan_radio_timeline", this, NULL, TL_REQUIRES_NOTHING, tap_timeline_reset, tap_timeline_packet, NULL/*tap_draw_cb tap_draw*/); + if (error_string) { + report_failure("Wireless Timeline - tap registration failed: %s", error_string->str); + g_string_free(error_string, TRUE); + } } void WirelessTimeline::resizeEvent(QResizeEvent*) |