From: YoungHun Kim Date: Fri, 11 Sep 2020 06:41:59 +0000 (+0900) Subject: fixup! Set null after unregistering mainloop to fix heap-use-after-free X-Git-Tag: submit/tizen/20200911.074610^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb91d03c2b24a50e6af5d9dcb035ce07fc267c9d;p=platform%2Fupstream%2Fmurphy.git fixup! Set null after unregistering mainloop to fix heap-use-after-free - Added setting null missing after mrp_mainloop_destroy Change-Id: I6ac05b3caf15e1366aa5932ffa0382ca514e03d1 --- diff --git a/src/core/context.c b/src/core/context.c index fd01cce..a0a28b5 100644 --- a/src/core/context.c +++ b/src/core/context.c @@ -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); } diff --git a/src/plugins/resource-native/resource-client.c b/src/plugins/resource-native/resource-client.c index 146240b..a920eb3 100644 --- a/src/plugins/resource-native/resource-client.c +++ b/src/plugins/resource-native/resource-client.c @@ -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);