summaryrefslogtreecommitdiff
path: root/ui/qt/interface_tree_cache_model.h
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-06-26 23:40:22 +0200
committerRoland Knall <rknall@gmail.com>2017-06-27 21:16:10 +0000
commit6bc0ba845100acb3c721e4f945bafeb1bed6c942 (patch)
treeb494ef606a66643fce9be1d46c075ec57449326b /ui/qt/interface_tree_cache_model.h
parent381fd410cbea10207d15ee9bd05eaa18f91c60ac (diff)
downloadwireshark-6bc0ba845100acb3c721e4f945bafeb1bed6c942.tar.gz
Qt: fix alloc-dealloc-mismatch while adding named pipe
ManageInterfacesDialog::on_addPipe_clicked uses g_new0 to create an "interface_t" instance, but InterfaceTreeCacheModel uses qDeleteAll which results in ASAN reporting "alloc-dealloc-mismatch (malloc vs operator delete)". To fix this, remove the dynamic allocation and make InterfaceTreeCacheModel store the instance internally. Change-Id: I9426dfc88d0a54a889bbbc9cf336c0a6af76920e Reviewed-on: https://code.wireshark.org/review/22410 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/interface_tree_cache_model.h')
-rw-r--r--ui/qt/interface_tree_cache_model.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/qt/interface_tree_cache_model.h b/ui/qt/interface_tree_cache_model.h
index cee1c0bea0..b5bd1ba8e3 100644
--- a/ui/qt/interface_tree_cache_model.h
+++ b/ui/qt/interface_tree_cache_model.h
@@ -51,7 +51,7 @@ public:
void reset(int row);
void save();
- void addDevice(interface_t * newDevice);
+ void addDevice(const interface_t * newDevice);
void deleteDevice(const QModelIndex &index);
#endif
@@ -59,7 +59,7 @@ private:
InterfaceTreeModel * sourceModel;
#ifdef HAVE_LIBPCAP
- QList<interface_t *> newDevices;
+ QList<interface_t> newDevices;
void saveNewDevices();
#endif
@@ -68,7 +68,7 @@ private:
QList<InterfaceTreeColumns> checkableColumns;
#ifdef HAVE_LIBPCAP
- interface_t * lookup(const QModelIndex &index) const;
+ const interface_t * lookup(const QModelIndex &index) const;
#endif
bool changeIsAllowed(InterfaceTreeColumns col) const;