[PATCH v2 2/3] virnetdev: Resolve Coverity FORWARD_NULL

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

 



The complaint is that if cleanup is called when virFileReadAll fails,
then mcast->entries is NULL and could be dereferenced in the clear
function. After following the code some - I saw that the caller to
the function (virNetDevGetMulticastTable) will also call
virNetDevMcastListClear if this function returns -1, so this
isn't necessary, so I removed the call.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/util/virnetdev.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 36e84d7..4fea4cb 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -2200,9 +2200,6 @@ static int virNetDevGetMcastList(const char *ifname,
 
     ret = 0;
  cleanup:
-    if (ret < 0)
-        virNetDevMcastListClear(mcast);
-
     VIR_FREE(entry);
 
     return ret;
-- 
1.9.3

--
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]