Re: [xml] Memory leak using xmlSchemaParse()
- From: Andreas Stricker <andreas stricker fela ch>
- To: xml gnome org
- Subject: Re: [xml] Memory leak using xmlSchemaParse()
- Date: Fri, 01 Jun 2007 15:24:34 +0200
Barbara PHILIPPOT wrote:
/* Si le XML Schema n'a pas pu être chargé*/
if (ptr_schema == NULL){
printf("XMLSCHEMA: Could not open XML Schema %s\n",
XMLSchemaFile_pathname);
xmlSchemaCleanupTypes();
xmlCleanupParser();
xmlMemoryDump();
return vl_return;
}
....
....
xmlSchemaFree(ptr_schema);
....
}
This seems a bit odd. You should initialize the parser for with
LIBXML_TEST_VERSION. Then after all is done call xmlCleanupParser().
Initializing is usually done once at program startup and xmlCleanupParser()
once at program end.
I don't know if the expression (ptr_schema == NULL) evaluates to true and
xmlCleanupParser() is called? But even if so, xmlSchemaFree() should
not be called after xmlCleanupParser().
Cheers, Andy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]