diff options
author | Etan Kissling <etan.kissling@gmail.com> | 2021-07-22 11:41:28 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2021-08-12 17:02:07 +0100 |
commit | 82de7a1e9673e1837530f1b6d29cb30006d2aa60 (patch) | |
tree | 22f423087a179af759cacc97fb6649aeed00520e | |
parent | 8e9bde57c5e3038cfedbb8ced39cc0103a86df24 (diff) | |
download | dnsmasq-82de7a1e9673e1837530f1b6d29cb30006d2aa60.tar.gz |
Re-order UBus teardown logic.
When destroying the UBus context, private fields of our ubus_object were
being reset to 0 while UBus was still owning those objects. While this
seems to work out fine, it seems cleaner to first release the object so
that UBus no longer owns it, before proceding to reset those fields.
Signed-off-by: Etan Kissling <etan.kissling@gmail.com>
-rw-r--r-- | src/ubus.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -81,12 +81,12 @@ static void ubus_subscribe_cb(struct ubus_context *ctx, struct ubus_object *obj) static void ubus_destroy(struct ubus_context *ubus) { + ubus_free(ubus); + daemon->ubus = NULL; + // Forces re-initialization when we're reusing the same definitions later on. ubus_object.id = 0; ubus_object_type.id = 0; - - ubus_free(ubus); - daemon->ubus = NULL; } static void ubus_disconnect_cb(struct ubus_context *ubus) |