]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
set modinfo to null last
authorChristian McDonald <cmcdonald@netgate.com>
Wed, 1 Feb 2023 20:17:59 +0000 (15:17 -0500)
committerChristian McDonald <cmcdonald@netgate.com>
Wed, 1 Feb 2023 20:17:59 +0000 (15:17 -0500)
pythonmod/pythonmod.c

index 74a5d66079eaa05411ac1693732eacea42f0964e..d4042995eda4594a85ca67ccdf54f4f4dcb54e8e 100644 (file)
@@ -566,12 +566,12 @@ void pythonmod_deinit(struct module_env* env, int id)
    pe->fname = NULL;
    free(pe);
 
-   /* Module is deallocated in Python */
-   env->modinfo[id] = NULL;
-
    /* iterate over all possible callback types and clean up each in turn */
    for (int cbtype = 0; cbtype < inplace_cb_types_total; cbtype++)
       inplace_cb_delete(env, cbtype, id);
+
+   /* Module is deallocated in Python */
+   env->modinfo[id] = NULL;
 }
 
 void pythonmod_inform_super(struct module_qstate* qstate, int id, struct module_qstate* super)