fixup! Set null after unregistering mainloop to fix heap-use-after-free 10/243910/3 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.111713 accepted/tizen/6.0/unified/hotfix/20201102.231645 accepted/tizen/unified/20200914.131428 submit/tizen/20200911.074610 submit/tizen_6.0/20201029.205503 submit/tizen_6.0_hotfix/20201102.192903 submit/tizen_6.0_hotfix/20201103.115103 tizen_6.0.m2_release
authorYoungHun Kim <yh8004.kim@samsung.com>
Fri, 11 Sep 2020 06:41:59 +0000 (15:41 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Fri, 11 Sep 2020 07:06:44 +0000 (16:06 +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);