1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-20 03:52:25 +03:00

change suggested by Anthony Carrico when unregistering a namespace prefix

* xpath.c: change suggested by Anthony Carrico when unregistering
  a namespace prefix to a context
* hash.c: be more careful about calling callbacks with NULL payloads.
Daniel
This commit is contained in:
Daniel Veillard
2003-10-29 11:18:37 +00:00
parent ceffd45199
commit e991fe958f
4 changed files with 15 additions and 5 deletions

View File

@@ -2974,6 +2974,9 @@ xmlXPathRegisterNs(xmlXPathContextPtr ctxt, const xmlChar *prefix,
ctxt->nsHash = xmlHashCreate(10);
if (ctxt->nsHash == NULL)
return(-1);
if (ns_uri == NULL)
return(xmlHashRemoveEntry(ctxt->nsHash, ns_uri,
(xmlHashDeallocator)xmlFree));
return(xmlHashUpdateEntry(ctxt->nsHash, prefix, (void *) xmlStrdup(ns_uri),
(xmlHashDeallocator)xmlFree));
}