mpathpersist:check variable 'conf' before using it
authortang.wenji <tang.wenji@zte.com.cn>
Thu, 3 Nov 2016 03:32:15 +0000 (11:32 +0800)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 3 Nov 2016 13:46:33 +0000 (14:46 +0100)
If the variable 'conf' is NULL, the program should exit.

Signed-off-by: tang.wenji <tang.wenji@zte.com.cn>
mpathpersist/main.c

index 8e8cc35..5863082 100644 (file)
@@ -105,6 +105,11 @@ int main (int argc, char * argv[])
 
        udev = udev_new();
        conf = mpath_lib_init(udev);
+       if(!conf) {
+               udev_unref(udev);
+               exit(1);
+       }
+       
        memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct transportid));
        multipath_conf = conf;