From: Zdenek Kabelac Date: Mon, 25 Oct 2010 12:57:00 +0000 (+0000) Subject: Fix potential NULL pointer dereference X-Git-Tag: v2_02_91~1440 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=30b36dc0e8c93e7c61efd8aadfa5c63d2cab77f8;p=lvm2.git 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). --- diff --git a/tools/lvm.c b/tools/lvm.c index 60f9a79af..9cac23e17 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) {