Signed-off-by: Jiri Denemark
Reviewed-by: Ján Tomko
---
Notes:
Version 2:
- no change
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 b0fdd15d6c..3224ec3f52 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
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list