[PATCH 1/2] virSysinfoParseProcessor: Drop useless check for NULL

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

 



VIR_STRDUP plays nicely with NULLs. Theres no need to guard its
call with check for non-NULL.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virsysinfo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 4edce66..8bb17f0 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -315,8 +315,7 @@ virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
                         cur, eol - cur) < 0)
             goto error;
 
-        if (processor_type &&
-            VIR_STRDUP(processor->processor_type, processor_type) < 0)
+        if (VIR_STRDUP(processor->processor_type, processor_type) < 0)
             goto error;
 
         base = cur;
-- 
2.3.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]