[libxml2] Fix memory leak when doc is NULL
- From: Rob Richards <rrichard src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libxml2] Fix memory leak when doc is NULL
- Date: Thu, 24 Sep 2009 15:01:37 +0000 (UTC)
commit 410d2c4e90c8892fa69ca40161d5eddf55875f3a
Author: Rob Richards <rrichards cdatazone org>
Date: Thu Sep 24 11:00:16 2009 -0400
Fix memory leak when doc is NULL
* xmlschemas.c: fix memory leak when doc is NULL
xmlschemas.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/xmlschemas.c b/xmlschemas.c
index 56c65e3..9c86c75 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -10531,9 +10531,9 @@ doc_load:
/* Parse from memory buffer. */
doc = xmlCtxtReadMemory(parserCtxt, schemaBuffer, schemaBufferLen,
NULL, NULL, SCHEMAS_PARSE_OPTIONS);
- schemaLocation = xmlStrdup(BAD_CAST "in_memory_buffer");
+ schemaLocation = BAD_CAST "in_memory_buffer";
if (doc != NULL)
- doc->URL = schemaLocation;
+ doc->URL = xmlStrdup(schemaLocation);
}
/*
* For <import>:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]