From: Ján Tomko Date: Wed, 10 Feb 2016 15:30:38 +0000 (+0100) Subject: virhook: do not save the return value of virBuildPath X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=21e2e08191fcc5ae7a9808c24c72e3393ad04677;p=libvirt.git virhook: do not save the return value of virBuildPath This function returns -1 on allocation error, there's no need to check the path for NULL again. --- diff --git a/src/util/virhook.c b/src/util/virhook.c index ee19382c4a..ba505984ec 100644 --- a/src/util/virhook.c +++ b/src/util/virhook.c @@ -119,8 +119,7 @@ virHookCheck(int no, const char *driver) return -1; } - ret = virBuildPath(&path, LIBVIRT_HOOK_DIR, driver); - if ((ret < 0) || (path == NULL)) { + if (virBuildPath(&path, LIBVIRT_HOOK_DIR, driver) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to build path for %s hook"), driver); @@ -276,8 +275,7 @@ virHookCall(int driver, if (extra == NULL) extra = "-"; - ret = virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr); - if ((ret < 0) || (path == NULL)) { + if (virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to build path for %s hook"), drvstr);