diff --git a/callback.c b/callback.c index 09a5e49b..6a888e89 100644 --- a/callback.c +++ b/callback.c @@ -65,7 +65,8 @@ void delete_callbacks_for_context(void *ctx) cbhead = newhead; cbtail = newtail; - newtail->next = NULL; + if (newtail) + newtail->next = NULL; } void queue_toplevel_callback(toplevel_callback_fn_t fn, void *ctx)