avl_init(&ctx->objects, ubus_cmp_id, false, NULL);
if (ubus_reconnect(ctx, path)) {
free(ctx->msgbuf.data);
+ ctx->msgbuf.data = NULL;
return -1;
}
void ubus_shutdown(struct ubus_context *ctx)
{
blob_buf_free(&b);
+ if (!ctx)
+ return;
close(ctx->sock.fd);
free(ctx->msgbuf.data);
}