]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
network: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Thu, 4 Sep 2014 20:27:58 +0000 (16:27 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 11 Sep 2014 12:10:13 +0000 (08:10 -0400)
If the VIR_STRDUP(exptime,...) fails, then we will jump to cleanup,
no need to check if exptime is set which causes Coverity to issue
a complaint in the virStrToLong_ll call because there wasn't a check
for a NULL value while there was one for the reference right after
the VIR_STRDUP().

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/network/leaseshelper.c

index c8543a2dee064989cc687d418221abe6def32b93..5b3c9c3bc78c06a8ad9f0ed8a7d3aec7a7f9ff44 100644 (file)
@@ -180,8 +180,7 @@ main(int argc, char **argv)
         goto cleanup;
 
     /* Removed extraneous trailing space in DNSMASQ_LEASE_EXPIRES (dnsmasq < 2.52) */
-    if (exptime &&
-        exptime[strlen(exptime) - 1] == ' ')
+    if (exptime[strlen(exptime) - 1] == ' ')
         exptime[strlen(exptime) - 1] = '\0';
 
     /* Check if it is an IPv6 lease */