[PATCH 01/18] vsh: Drop useless check for opts != NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All our internal *Free() functions are capable of handling NULL.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 tools/vsh.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index e878119b9..e38dcec92 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -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;
 }
-- 
2.13.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux