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>
This commit is contained in:
Oldřich Jedlička
2020-03-18 22:24:55 +01:00
committed by Simon Kelley
parent 0506a5ed4e
commit 3f60ecd6f0

View File

@@ -102,6 +102,7 @@ void ubus_init()
my_syslog(LOG_ERR, _("Cannot add object to UBus: %s"), ubus_strerror(ret));
error_logged = 1;
}
ubus_destroy(ubus);
return;
}