Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/conf/domain_capabilities.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 1000d8b969..37e767d5c9 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -246,25 +246,20 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
virDomainCapsCPUUsable usable,
char **blockers)
{
- char *nameCopy = NULL;
- char **blockersCopy = NULL;
+ VIR_AUTOFREE(char *) nameCopy = NULL;
+ VIR_AUTOSTRINGLIST blockersCopy = NULL;
if (VIR_STRNDUP(nameCopy, name, nameLen) < 0)
- goto error;
+ return -1;
if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0)
- goto error;
+ return -1;
if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy,
usable, &blockersCopy) < 0)
- goto error;
+ return -1;
return 0;
-
- error:
- VIR_FREE(nameCopy);
- virStringListFree(blockersCopy);
- return -1;
}
--
2.23.0