From: John Ferlan Date: Tue, 1 Sep 2015 10:56:38 +0000 (-0400) Subject: virfile: Avoid Coverity IDENTICAL_BRANCHES error X-Git-Tag: v1.2.20-rc1~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53caf99db67dbfd245abd4bb83c3cef10f44197a;p=thirdparty%2Flibvirt.git virfile: Avoid Coverity IDENTICAL_BRANCHES error In virFileNBDDeviceFindUnused if virFileNBDDeviceIsBusy returns 0, then both branches jumped to cleanup, so just use ignore_value since the function returns NULL or some memory and the caller handles the error. --- diff --git a/src/util/virfile.c b/src/util/virfile.c index e3c00efd90..408d2d912f 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -797,8 +797,7 @@ virFileNBDDeviceFindUnused(void) if (rv < 0) goto cleanup; if (rv == 0) { - if (virAsprintf(&ret, "/dev/%s", de->d_name) < 0) - goto cleanup; + ignore_value(virAsprintf(&ret, "/dev/%s", de->d_name)); goto cleanup; } }