From: YoungHun Kim Date: Wed, 12 Aug 2020 23:18:18 +0000 (+0900) Subject: Set null after unregistering mainloop to fix heap-use-after-free X-Git-Tag: submit/tizen/20200813.010450^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F240911%2F1;p=platform%2Fupstream%2Fmurphy.git Set null after unregistering mainloop to fix heap-use-after-free Change-Id: I7679ee06fd20e03b5a76f54c7a7c0b586439c2bd --- diff --git a/packaging/murphy.spec b/packaging/murphy.spec index 6949b37..7708bea 100644 --- a/packaging/murphy.spec +++ b/packaging/murphy.spec @@ -29,7 +29,7 @@ Summary: Resource policy framework Name: murphy Version: 0.0.75 -Release: 18 +Release: 19 License: BSD-3-Clause Group: System/Service URL: http://01.org/murphy/ diff --git a/src/common/qt-glue.cpp b/src/common/qt-glue.cpp index 8fbf636..5ac8f16 100644 --- a/src/common/qt-glue.cpp +++ b/src/common/qt-glue.cpp @@ -363,9 +363,12 @@ static void unregister(void *glue_data) { QtGlue *qt_glue = (QtGlue *)glue_data; - mrp_debug("unregistering mainloop"); + mrp_debug("unregistering mainloop [%p]", qt_glue); - delete qt_glue; + if (qt_glue) { + delete qt_glue; + qt_glue = NULL; + } }