Checker name is not displayed on failure
authorHannes Reinecke <hare@suse.de>
Tue, 8 Jan 2013 13:53:49 +0000 (14:53 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 8 Jan 2013 22:33:27 +0000 (23:33 +0100)
If add_checker() isn't able to locate the checker
it won't display the name in free_checker().

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/prio.c

index cf97fad..8e6b93e 100644 (file)
@@ -86,6 +86,7 @@ struct prio * add_prio (char * name)
        p = alloc_prio();
        if (!p)
                return NULL;
+       snprintf(p->name, PRIO_NAME_LEN, "%s", name);
        snprintf(libname, LIB_PRIO_NAMELEN, "%s/libprio%s.so",
                 conf->multipath_dir, name);
        if (stat(libname,&stbuf) < 0) {
@@ -107,7 +108,6 @@ struct prio * add_prio (char * name)
                condlog(0, "A dynamic linking error occurred: (%s)", errstr);
        if (!p->getprio)
                goto out;
-       snprintf(p->name, PRIO_NAME_LEN, "%s", name);
        list_add(&p->node, &prioritizers);
        return p;
 out: