mirror of
https://github.com/darlinghq/darling-libxml2.git
synced 2025-02-12 13:38:37 +00:00
applied patch from Florent Guilian to remove an useless mutex in the
* dict.c: applied patch from Florent Guilian to remove an useless mutex in the xmlDict structure. older, not commited ... * SAX2.c: another leak reported by Ashwin * xinclude.c: fixed the behaviour when XIncluding a fragment of the current document, patch from Chris Ryan Daniel svn path=/trunk/; revision=3686
This commit is contained in:
parent
ead3583b47
commit
b242b08831
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
||||
Fri Feb 8 10:54:09 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* dict.c: applied patch from Florent Guilian to remove an
|
||||
useless mutex in the xmlDict structure.
|
||||
|
||||
Wed Feb 6 17:00:20 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* SAX2.c: another leak reported by Ashwin
|
||||
* xinclude.c: fixed the behaviour when XIncluding a fragment
|
||||
of the current document, patch from Chris Ryan
|
||||
|
||||
Wed Feb 6 12:10:08 HKT 2008 William Brack <wbrack@mmm.com.hk>
|
||||
|
||||
* nanohttp.c: added space for port number (when not 80) in
|
||||
|
4
SAX2.c
4
SAX2.c
@ -2366,7 +2366,9 @@ xmlSAX2Reference(void *ctx, const xmlChar *name)
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"add xmlSAX2Reference %s to %s \n", name, ctxt->node->name);
|
||||
#endif
|
||||
xmlAddChild(ctxt->node, ret);
|
||||
if (xmlAddChild(ctxt->node, ret) == NULL) {
|
||||
xmlFreeNode(ret);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
9
dict.c
9
dict.c
@ -60,7 +60,6 @@ struct _xmlDictStrings {
|
||||
*/
|
||||
struct _xmlDict {
|
||||
int ref_counter;
|
||||
xmlRMutexPtr mutex;
|
||||
|
||||
struct _xmlDictEntry *dict;
|
||||
int size;
|
||||
@ -337,11 +336,8 @@ xmlDictCreate(void) {
|
||||
dict->strings = NULL;
|
||||
dict->subdict = NULL;
|
||||
if (dict->dict) {
|
||||
if ((dict->mutex = xmlNewRMutex()) != NULL) {
|
||||
memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry));
|
||||
return(dict);
|
||||
}
|
||||
xmlFree(dict->dict);
|
||||
memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry));
|
||||
return(dict);
|
||||
}
|
||||
xmlFree(dict);
|
||||
}
|
||||
@ -545,7 +541,6 @@ xmlDictFree(xmlDictPtr dict) {
|
||||
xmlFree(pool);
|
||||
pool = nextp;
|
||||
}
|
||||
xmlFreeRMutex(dict->mutex);
|
||||
xmlFree(dict);
|
||||
}
|
||||
|
||||
|
16
xinclude.c
16
xinclude.c
@ -516,9 +516,8 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
|
||||
href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */
|
||||
if (href == NULL)
|
||||
return(-1);
|
||||
local = 1;
|
||||
}
|
||||
if (href[0] == '#')
|
||||
if ((href[0] == '#') || (href[0] == 0))
|
||||
local = 1;
|
||||
parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE);
|
||||
if (parse != NULL) {
|
||||
@ -616,6 +615,19 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If local and xml then we need a fragment
|
||||
*/
|
||||
if ((local == 1) && (xml == 1) &&
|
||||
((fragment == NULL) || (fragment[0] == 0))) {
|
||||
xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
|
||||
"detected a local recursion with no xpointer in %s\n",
|
||||
URL);
|
||||
if (fragment != NULL)
|
||||
xmlFree(fragment);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the URL against the stack for recursions
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user