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:
3
xpath.c
3
xpath.c
@@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user