diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-06-19 11:01:56 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-06-19 10:47:10 +0000 |
commit | a383e692c8774c2451a55d8b3f8ef9db5d037329 (patch) | |
tree | ab6223527915ab1127a50563981816adc18b971f /ui/qt | |
parent | ff845123f1f1ecef0d8e0d8980e6e9d7267e5f6b (diff) |
Revert "tap: change glib functions to wmem."
This reverts commit 2e9f3c5d366eaa7139fc877b5301392166b3f985.
It breaks the registration of codec, dissector and libwiretap plugins.
Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de
Reviewed-on: https://code.wireshark.org/review/16012
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/bluetooth_device_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/bluetooth_hci_summary_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/expert_info_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/gsm_map_summary_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/io_graph_dialog.cpp | 13 | ||||
-rw-r--r-- | ui/qt/lbm_lbtrm_transport_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/lbm_lbtru_transport_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/lbm_stream_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/mtp3_summary_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/wireshark_dialog.cpp | 6 |
10 files changed, 33 insertions, 34 deletions
diff --git a/ui/qt/bluetooth_device_dialog.cpp b/ui/qt/bluetooth_device_dialog.cpp index a3a50d99f9..5c72f2d2a4 100644 --- a/ui/qt/bluetooth_device_dialog.cpp +++ b/ui/qt/bluetooth_device_dialog.cpp @@ -96,7 +96,7 @@ bluetooth_device_tap_reset(void *tapinfo_ptr) static void bluetooth_devices_tap(void *data) { - gchar *error_string; + GString *error_string; error_string = register_tap_listener("bluetooth.device", data, NULL, 0, @@ -107,8 +107,8 @@ bluetooth_devices_tap(void *data) if (error_string != NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "%s", error_string); - g_free(error_string); + "%s", error_string->str); + g_string_free(error_string, TRUE); } } diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp index 87aad65e67..a29d3f8136 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.cpp +++ b/ui/qt/bluetooth_hci_summary_dialog.cpp @@ -79,7 +79,7 @@ bluetooth_device_tap_reset(void *tapinfo_ptr) static void bluetooth_devices_tap(void *data) { - gchar *error_string; + GString *error_string; error_string = register_tap_listener("bluetooth.hci_summary", data, NULL, 0, @@ -90,8 +90,8 @@ bluetooth_devices_tap(void *data) if (error_string != NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "%s", error_string); - wmem_free(NULL, error_string); + "%s", error_string->str); + g_string_free(error_string, TRUE); } } diff --git a/ui/qt/expert_info_dialog.cpp b/ui/qt/expert_info_dialog.cpp index 7dfb3101a5..ea19f1f60f 100644 --- a/ui/qt/expert_info_dialog.cpp +++ b/ui/qt/expert_info_dialog.cpp @@ -312,11 +312,11 @@ void ExpertInfoDialog::retapPackets() } if (ui->limitCheckBox->isChecked()) { - gchar *error_string = set_tap_dfilter(this, display_filter_.toUtf8().constData()); + GString *error_string = set_tap_dfilter(this, display_filter_.toUtf8().constData()); if (error_string) { QMessageBox::warning(this, tr("Endpoint expert failed to set filter"), - error_string); - wmem_free(NULL, error_string); + error_string->str); + g_string_free(error_string, TRUE); return; } } diff --git a/ui/qt/gsm_map_summary_dialog.cpp b/ui/qt/gsm_map_summary_dialog.cpp index 2ad0c5c0c1..3265068e94 100644 --- a/ui/qt/gsm_map_summary_dialog.cpp +++ b/ui/qt/gsm_map_summary_dialog.cpp @@ -371,7 +371,7 @@ gsm_map_summary_packet(void *tapdata, packet_info *, epan_dissect_t *, const voi void register_tap_listener_qt_gsm_map_summary(void) { - gchar *err_p; + GString *err_p; memset((void *) &gsm_map_stat, 0, sizeof(gsm_map_stat_t)); @@ -383,8 +383,8 @@ register_tap_listener_qt_gsm_map_summary(void) if (err_p != NULL) { - simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p); - wmem_free(NULL, err_p); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str); + g_string_free(err_p, TRUE); exit(1); } diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp index 3b18fffb0d..7270d49572 100644 --- a/ui/qt/io_graph_dialog.cpp +++ b/ui/qt/io_graph_dialog.cpp @@ -1650,7 +1650,7 @@ IOGraph::IOGraph(QCustomPlot *parent) : graph_ = parent_->addGraph(parent_->xAxis, parent_->yAxis); Q_ASSERT(graph_ != NULL); - gchar *error_string; + GString *error_string; error_string = register_tap_listener("frame", this, "", @@ -1661,7 +1661,7 @@ IOGraph::IOGraph(QCustomPlot *parent) : if (error_string) { // QMessageBox::critical(this, tr("%1 failed to register tap listener").arg(name_), // error_string->str); - wmem_free(NULL, error_string); + g_string_free(error_string, TRUE); } setFilter(QString()); @@ -1682,7 +1682,6 @@ IOGraph::~IOGraph() { void IOGraph::setFilter(const QString &filter) { GString *error_string; - gchar* filter_error_string; QString full_filter(filter.trimmed()); config_err_.clear(); @@ -1720,10 +1719,10 @@ void IOGraph::setFilter(const QString &filter) } } - filter_error_string = set_tap_dfilter(this, full_filter.toUtf8().constData()); - if (filter_error_string) { - config_err_ = filter_error_string; - wmem_free(NULL, filter_error_string); + error_string = set_tap_dfilter(this, full_filter.toUtf8().constData()); + if (error_string) { + config_err_ = error_string->str; + g_string_free(error_string, TRUE); return; } else { if (filter_.compare(filter) && visible_) { diff --git a/ui/qt/lbm_lbtrm_transport_dialog.cpp b/ui/qt/lbm_lbtrm_transport_dialog.cpp index 87a8b03b08..b232f927ed 100644 --- a/ui/qt/lbm_lbtrm_transport_dialog.cpp +++ b/ui/qt/lbm_lbtrm_transport_dialog.cpp @@ -1295,7 +1295,7 @@ void LBMLBTRMTransportDialog::resetReceiversDetail(void) void LBMLBTRMTransportDialog::fillTree(void) { - gchar * error_string; + GString * error_string; if (m_capture_file == NULL) { @@ -1313,8 +1313,8 @@ void LBMLBTRMTransportDialog::fillTree(void) if (error_string) { QMessageBox::critical(this, tr("LBT-RM Statistics failed to attach to tap"), - error_string); - wmem_free(NULL, error_string); + error_string->str); + g_string_free(error_string, TRUE); reject(); } diff --git a/ui/qt/lbm_lbtru_transport_dialog.cpp b/ui/qt/lbm_lbtru_transport_dialog.cpp index 65982b2d73..a787b12808 100644 --- a/ui/qt/lbm_lbtru_transport_dialog.cpp +++ b/ui/qt/lbm_lbtru_transport_dialog.cpp @@ -1715,7 +1715,7 @@ void LBMLBTRUTransportDialog::resetReceiversDetail(void) void LBMLBTRUTransportDialog::fillTree(void) { - gchar * error_string; + GString * error_string; if (m_capture_file == NULL) { @@ -1733,8 +1733,8 @@ void LBMLBTRUTransportDialog::fillTree(void) if (error_string) { QMessageBox::critical(this, tr("LBT-RU Statistics failed to attach to tap"), - error_string); - wmem_free(NULL, error_string); + error_string->str); + g_string_free(error_string, TRUE); reject(); } diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp index 1aa90d8b90..000527a679 100644 --- a/ui/qt/lbm_stream_dialog.cpp +++ b/ui/qt/lbm_stream_dialog.cpp @@ -372,7 +372,7 @@ void LBMStreamDialog::setCaptureFile(capture_file * cfile) void LBMStreamDialog::fillTree(void) { - gchar * error_string; + GString * error_string; if (m_capture_file == NULL) { @@ -390,8 +390,8 @@ void LBMStreamDialog::fillTree(void) if (error_string) { QMessageBox::critical(this, tr("LBM Stream failed to attach to tap"), - error_string); - wmem_free(NULL, error_string); + error_string->str); + g_string_free(error_string, TRUE); reject(); } diff --git a/ui/qt/mtp3_summary_dialog.cpp b/ui/qt/mtp3_summary_dialog.cpp index 2611238469..f009f939e9 100644 --- a/ui/qt/mtp3_summary_dialog.cpp +++ b/ui/qt/mtp3_summary_dialog.cpp @@ -371,7 +371,7 @@ mtp3_summary_packet( void register_tap_listener_qt_mtp3_summary(void) { - gchar *err_p; + GString *err_p; memset((void *) &mtp3_stat, 0, sizeof(mtp3_stat)); @@ -383,8 +383,8 @@ register_tap_listener_qt_mtp3_summary(void) if (err_p != NULL) { - simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p); - wmem_free(NULL, err_p); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str); + g_string_free(err_p, TRUE); exit(1); } diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp index 37066f8e0a..ba5cd12bb1 100644 --- a/ui/qt/wireshark_dialog.cpp +++ b/ui/qt/wireshark_dialog.cpp @@ -116,12 +116,12 @@ void WiresharkDialog::updateWidgets() bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void(*tap_reset)(void *), gboolean(*tap_packet)(void *, struct _packet_info *, struct epan_dissect *, const void *), void(*tap_draw)(void *)) { - gchar *error_string = register_tap_listener(tap_name, tap_data, filter, flags, + GString *error_string = register_tap_listener(tap_name, tap_data, filter, flags, tap_reset, tap_packet, tap_draw); if (error_string) { QMessageBox::warning(this, tr("Failed to attach to tap \"%1\"").arg(tap_name), - error_string); - wmem_free(NULL, error_string); + error_string->str); + g_string_free(error_string, TRUE); return false; } |