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 <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2023-06-05 22:05:55 +02:00
parent 9913aa61de
commit f787c97b34

View file

@ -368,6 +368,7 @@ void ubus_shutdown(struct ubus_context *ctx)
blob_buf_free(&b); blob_buf_free(&b);
if (!ctx) if (!ctx)
return; return;
uloop_fd_delete(&ctx->sock);
close(ctx->sock.fd); close(ctx->sock.fd);
uloop_timeout_cancel(&ctx->pending_timer); uloop_timeout_cancel(&ctx->pending_timer);
free(ctx->msgbuf.data); free(ctx->msgbuf.data);