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:
Daniel Veillard 2008-02-08 09:56:31 +00:00
parent ead3583b47
commit b242b08831
4 changed files with 30 additions and 10 deletions

View File

@ -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
View File

@ -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
View File

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

View File

@ -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
*/