From: Felix Fietkau Date: Mon, 5 Jun 2023 20:05:55 +0000 (+0200) Subject: libubus: add missing uloop_fd_delete call in ubus_shutdown X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f787c97b34894a38b15599886cacbca01271684f;p=project%2Fubus.git libubus: add missing uloop_fd_delete call in ubus_shutdown Leaving the fd added could cause segfaults if ctx is freed Signed-off-by: Felix Fietkau --- diff --git a/libubus.c b/libubus.c index fc0d933..d625940 100644 --- a/libubus.c +++ b/libubus.c @@ -368,6 +368,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);