]> sourceware.org Git - lvm2.git/commitdiff
Fix potential NULL pointer dereference
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 25 Oct 2010 12:57:00 +0000 (12:57 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 25 Oct 2010 12:57:00 +0000 (12:57 +0000)
Makes clang happier as it covers all code paths and avoids NULL pointer
dereference through the 'com' pointer (which is NULL by default static
initialisation).

tools/lvm.c

index 60f9a79af9ffedacac11774ae5d915c1116772be..9cac23e1777cb9f41fe3eacd346a27eeaaed768a 100644 (file)
@@ -85,11 +85,11 @@ static char *_list_args(const char *text, int state)
                                break;
                        }
                }
-
-               if (!com)
-                       return NULL;
        }
 
+       if (!com)
+               return NULL;
+
        /* Short form arguments */
        if (len < 3) {
                while (match_no < com->num_args) {
This page took 0.039388 seconds and 5 git commands to generate.