]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vsh: Drop useless check for opts != NULL
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 29 Dec 2017 11:19:47 +0000 (12:19 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 11 Jan 2018 17:53:04 +0000 (18:53 +0100)
All our internal *Free() functions are capable of handling NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/vsh.c

index e878119b988f70c324af170f2cd8936d00c4fae0..e38dcec92d7e1a3ef43fae0f07e90793dedd28f2 100644 (file)
@@ -799,8 +799,7 @@ vshCommandFree(vshCmd *cmd)
 
         c = c->next;
 
-        if (tmp->opts)
-            vshCommandOptFree(tmp->opts);
+        vshCommandOptFree(tmp->opts);
         VIR_FREE(tmp);
     }
 }
@@ -1581,8 +1580,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser)
         vshCommandFree(ctl->cmd);
         ctl->cmd = NULL;
     }
-    if (first)
-        vshCommandOptFree(first);
+    vshCommandOptFree(first);
     VIR_FREE(tkdata);
     return false;
 }