Loader fixes
authorMark Spencer <markster@digium.com>
Thu, 29 Apr 2004 04:13:06 +0000 (04:13 +0000)
committerMark Spencer <markster@digium.com>
Thu, 29 Apr 2004 04:13:06 +0000 (04:13 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2813 65c4cc65-6c06-0410-ace0-fbb531ad65f3

loader.c

index e6ff19f..7451fd4 100755 (executable)
--- a/loader.c
+++ b/loader.c
@@ -280,11 +280,11 @@ int ast_load_resource(char *resource_name)
        m->reload = dlsym(m->lib, "reload");
        if (m->reload == NULL)
                m->reload = dlsym(m->lib, "_reload");
-       if (m->key && !(key = m->key())) {
+       if (!m->key || !(key = m->key())) {
                ast_log(LOG_WARNING, "Key routine returned NULL in module %s\n", fn);
-               errors++;
-       } else
                key = NULL;
+               errors++;
+       }
        if (key && verify_key(key)) {
                ast_log(LOG_WARNING, "Unexpected key returned by module %s\n", fn);
                errors++;