CMakeLists.txt: bump minimum cmake version
[project/ubus.git] / libubus.c
index aee2a3b722a7d30756fe6a2ceac081c1775326c7..c9c3c6e5c2484b23b06ffc2407f2cbc476b6eb62 100644 (file)
--- a/libubus.c
+++ b/libubus.c
@@ -34,6 +34,9 @@ const char *__ubus_strerror[__UBUS_STATUS_LAST] = {
        [UBUS_STATUS_NOT_SUPPORTED] = "Operation not supported",
        [UBUS_STATUS_UNKNOWN_ERROR] = "Unknown error",
        [UBUS_STATUS_CONNECTION_FAILED] = "Connection failed",
+       [UBUS_STATUS_NO_MEMORY] = "Out of memory",
+       [UBUS_STATUS_PARSE_ERROR] = "Parsing message data failed",
+       [UBUS_STATUS_SYSTEM_ERROR] = "System error",
 };
 
 struct blob_buf b __hidden = {};
@@ -295,6 +298,7 @@ int ubus_connect_ctx(struct ubus_context *ctx, const char *path)
 
        INIT_LIST_HEAD(&ctx->requests);
        INIT_LIST_HEAD(&ctx->pending);
+       INIT_LIST_HEAD(&ctx->auto_subscribers);
        avl_init(&ctx->objects, ubus_cmp_id, false, NULL);
        if (ubus_reconnect(ctx, path)) {
                free(ctx->msgbuf.data);
@@ -365,6 +369,7 @@ void ubus_shutdown(struct ubus_context *ctx)
        blob_buf_free(&b);
        if (!ctx)
                return;
+       uloop_fd_delete(&ctx->sock);
        close(ctx->sock.fd);
        uloop_timeout_cancel(&ctx->pending_timer);
        free(ctx->msgbuf.data);