commit | 3f60ecd6f0a2241d0a881ec9de7e48f65683a06e | [log] [tgz] |
---|---|---|
author | Oldřich Jedlička <oldium.pro@gmail.com> | Wed Mar 18 22:24:55 2020 +0100 |
committer | Simon Kelley <simon@thekelleys.org.uk> | Thu Mar 19 22:20:18 2020 +0000 |
tree | 2cdf53e8fc4fb87d143633cae1aa84bdafaa0de6 | |
parent | 0506a5ed4e56863627c54aedad30ad61221292ef [diff] |
Fixed resource leak on ubus_init failure. When ubus_add_object fails, the ubus_connect object is not freed, so the connection leaks. Add ubus_destroy to free the connection object. Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
diff --git a/src/ubus.c b/src/ubus.c index 79e2563..c7f6b19 100644 --- a/src/ubus.c +++ b/src/ubus.c
@@ -102,6 +102,7 @@ my_syslog(LOG_ERR, _("Cannot add object to UBus: %s"), ubus_strerror(ret)); error_logged = 1; } + ubus_destroy(ubus); return; }