Wireshark-commits: [Wireshark-commits] master-2.0 4056712: Fix memleaks related to get_dirname
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=40567122ab0a31268a6590bdaa85c1af937e9996
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master-2.0
Repository: wireshark
Commits:
4056712 by Peter Wu (peter@xxxxxxxxxxxxx):
Fix memleaks related to get_dirname
get_dirname may return NULL instead of the original string, so avoid
patterns like get_dirname(strdup(x)). Writing to
cf_path.toUtf8().data() is fine btw, toUtf8() returns new memory.
This fixes two memleak reported by LeakSanitizer via fileset_add_dir and
MainWindow::captureFileReadFinished (both via cf_callback_invoke).
Change-Id: I0f1528763e77e1f55b54b6674c890a9d02302ee8
Reviewed-on: https://code.wireshark.org/review/13691
Petri-Dish: Dario Lombardo <lomato@xxxxxxxxx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
(cherry picked from commit 8899e006aab3e0831214d187596eef450b5e21b7)
Reviewed-on: https://code.wireshark.org/review/13704
Actions performed:
from bb5235e OSPF: Wrong interpretation of Instance ID value in OSPFv3 packet
adds 4056712 Fix memleaks related to get_dirname
Summary of changes:
fileset.c | 4 ++--
ui/gtk/main.c | 12 ++++++------
ui/qt/main_window.cpp | 8 ++++----
ui/qt/main_window_slots.cpp | 6 +++---
wireshark-qt.cpp | 4 ++--
5 files changed, 17 insertions(+), 17 deletions(-)