mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
virschematest: call va_end even on OOM
Jump to cleanup if virAsprintf fails.
This commit is contained in:
parent
609ba3a751
commit
09b406a756
@ -120,7 +120,7 @@ testSchemaDir(const char *schema,
|
||||
static int
|
||||
testSchemaDirs(const char *schema, ...)
|
||||
{
|
||||
virXMLValidatorPtr validator;
|
||||
virXMLValidatorPtr validator = NULL;
|
||||
va_list args;
|
||||
int ret = 0;
|
||||
char *schema_path = NULL;
|
||||
@ -130,7 +130,7 @@ testSchemaDirs(const char *schema, ...)
|
||||
va_start(args, schema);
|
||||
|
||||
if (virAsprintf(&schema_path, "%s/docs/schemas/%s", abs_topsrcdir, schema) < 0)
|
||||
return -1;
|
||||
goto cleanup;
|
||||
|
||||
if (!(validator = virXMLValidatorInit(schema_path)))
|
||||
goto cleanup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user