Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/util/virxml.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/util/virxml.c b/src/util/virxml.c
index 6b5ed08426..a236e4e7a0 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -73,7 +73,6 @@ virXPathString(const char *xpath,
xmlXPathContextPtr ctxt)
{
g_autoptr(xmlXPathObject) obj = NULL;
- char *ret;
if ((ctxt == NULL) || (xpath == NULL)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -85,8 +84,7 @@ virXPathString(const char *xpath,
(obj->stringval == NULL) || (obj->stringval[0] == 0)) {
return NULL;
}
- ret = g_strdup((char *)obj->stringval);
- return ret;
+ return g_strdup((char *)obj->stringval);
}
@@ -887,7 +885,6 @@ virXPathBoolean(const char *xpath,
xmlXPathContextPtr ctxt)
{
g_autoptr(xmlXPathObject) obj = NULL;
- int ret;
if ((ctxt == NULL) || (xpath == NULL)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -899,9 +896,7 @@ virXPathBoolean(const char *xpath,
(obj->boolval < 0) || (obj->boolval > 1)) {
return -1;
}
- ret = obj->boolval;
-
- return ret;
+ return obj->boolval;
}
/**
@@ -919,7 +914,6 @@ virXPathNode(const char *xpath,
xmlXPathContextPtr ctxt)
{
g_autoptr(xmlXPathObject) obj = NULL;
- xmlNodePtr ret;
if ((ctxt == NULL) || (xpath == NULL)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -933,8 +927,7 @@ virXPathNode(const char *xpath,
return NULL;
}
- ret = obj->nodesetval->nodeTab[0];
- return ret;
+ return obj->nodesetval->nodeTab[0];
}
/**
--
2.31.1