From: John Ferlan Date: Wed, 29 Oct 2014 22:21:17 +0000 (-0400) Subject: virnetdev: Resolve Coverity FORWARD_NULL X-Git-Tag: v1.2.10-rc2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f099726c4684d76cde714bfc5edbd9bbec35da49;p=thirdparty%2Flibvirt.git virnetdev: Resolve Coverity FORWARD_NULL 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. --- diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 36e84d7a99..4fea4cb4ef 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;