virschematest: call va_end even on OOM

Jump to cleanup if virAsprintf fails.
This commit is contained in:
Ján Tomko 2016-06-08 16:33:26 +02:00
parent 609ba3a751
commit 09b406a756

View File

@ -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;