From e9431842e2fd73c4f96542cf71f40ae4c4c5c930 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 14 Dec 2012 21:27:52 +0100 Subject: [PATCH] libubus: check if subscriber cb is non-NULL before calling it Signed-off-by: Felix Fietkau --- libubus-sub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libubus-sub.c b/libubus-sub.c index 8ffb018..167630c 100644 --- a/libubus-sub.c +++ b/libubus-sub.c @@ -21,7 +21,8 @@ static int ubus_subscriber_cb(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_subscriber *s; s = container_of(obj, struct ubus_subscriber, obj); - s->cb(ctx, obj, req, method, msg); + if (s->cb) + s->cb(ctx, obj, req, method, msg); return 0; } -- 2.30.2