ubusd: replace ubusd_msg_unshare() with ubus_msg_new() to prevent invalid free-ing
[project/ubus.git] / libubus-req.c
index cdb8393efab94858b5a6f14ee322ae9e22469e61..f24f033d9d65da38ebbd5dac53f2cce4a16b4df3 100644 (file)
@@ -171,11 +171,12 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
        if (req->complete_cb)
                req->complete_cb(req, status);
 
-       if (!registered)
+       if (!registered) {
                uloop_fd_delete(&ctx->sock);
 
-       if (!ctx->stack_depth)
-               ubus_process_pending_msg(ctx);
+               if (ctx->stack_depth)
+                       ctx->pending_timer.cb(&ctx->pending_timer);
+       }
 
        return status;
 }