]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: register props even with just config
authorMarek Vavruša <marek.vavrusa@nic.cz>
Tue, 20 Oct 2015 08:40:49 +0000 (10:40 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Tue, 20 Oct 2015 08:41:38 +0000 (10:41 +0200)
daemon/engine.c

index 954f78eab252bcd1c194fc26b276b93c83ee44a1..a874a918318266fac8664431550497085f3f54c9 100644 (file)
@@ -555,7 +555,7 @@ static int register_properties(struct engine *engine, struct kr_module *module)
        if (module->config != NULL) {
                REGISTER_MODULE_CALL(engine->L, module, module->config, "config");
        }
-       for (struct kr_prop *p = module->props; p->name; ++p) {
+       for (struct kr_prop *p = module->props; p && p->name; ++p) {
                if (p->cb != NULL && p->name != NULL) {
                        REGISTER_MODULE_CALL(engine->L, module, p->cb, p->name);
                }
@@ -640,7 +640,7 @@ int engine_register(struct engine *engine, const char *name, const char *precede
        }
 
        /* Register properties */
-       if (module->props) {
+       if (module->props || module->config) {
                return register_properties(engine, module);
        }