提交 09b406a7 编写于 作者: J Ján Tomko

virschematest: call va_end even on OOM

Jump to cleanup if virAsprintf fails.
上级 609ba3a7
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册