summaryrefslogtreecommitdiffstats
path: root/tools/lvm.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2010-10-25 12:57:00 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2010-10-25 12:57:00 +0000
commit30b36dc0e8c93e7c61efd8aadfa5c63d2cab77f8 (patch)
tree1c6602124d92026367e59499abd62c554a347154 /tools/lvm.c
parent0775e8060e8cdeb31b94756657c5de0bec0a5922 (diff)
downloadlvm2-30b36dc0e8c93e7c61efd8aadfa5c63d2cab77f8.tar.gz
lvm2-30b36dc0e8c93e7c61efd8aadfa5c63d2cab77f8.tar.xz
lvm2-30b36dc0e8c93e7c61efd8aadfa5c63d2cab77f8.zip
Fix potential NULL pointer dereference
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).
Diffstat (limited to 'tools/lvm.c')
-rw-r--r--tools/lvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lvm.c b/tools/lvm.c
index 60f9a79a..9cac23e1 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -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) {