fixup! Set null after unregistering mainloop to fix heap-use-after-free 91/243991/1 accepted/tizen_5.5_unified tizen_5.5 accepted/tizen/5.5/unified/20200915.014149 submit/tizen_5.5/20200914.070142
authorYoungHun Kim <yh8004.kim@samsung.com>
Fri, 11 Sep 2020 06:41:59 +0000 (15:41 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Mon, 14 Sep 2020 00:43:23 +0000 (09:43 +0900)
 - Added setting null missing after mrp_mainloop_destroy

Change-Id: I6ac05b3caf15e1366aa5932ffa0382ca514e03d1

src/core/context.c
src/plugins/resource-native/resource-client.c

index fd01cce91558846eb0bb7b8de48daca302f84170..a0a28b54bb6af909d9403e668fae717e91441dcd 100644 (file)
@@ -62,6 +62,7 @@ void mrp_context_destroy(mrp_context_t *c)
     if (c != NULL) {
         console_cleanup(c);
         mrp_mainloop_destroy(c->ml);
+        c->ml = NULL;
         mrp_free(c);
     }
 
index 146240b353711340a0c04904fc986984e7990191..a920eb3a5e8e5708bb7cedf50e72ac2f9051e78f 100644 (file)
@@ -1774,6 +1774,7 @@ int main(int argc, char **argv)
     mrp_transport_destroy(client->transp);
 
     mrp_mainloop_destroy(client->ml);
+    client->ml = NULL;
     mrp_free((void *)client->name);
     resource_def_array_free(client->resources);
     str_array_free(client->class_names);