summaryrefslogtreecommitdiff
path: root/libxslt/keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'libxslt/keys.c')
-rw-r--r--libxslt/keys.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libxslt/keys.c b/libxslt/keys.c
index 34f7b51e..f23cc4e9 100644
--- a/libxslt/keys.c
+++ b/libxslt/keys.c
@@ -829,7 +829,10 @@ fprintf(stderr, "xsltInitCtxtKey %s : %d\n", keyDef->name, ctxt->keyInitLevel);
keylist = xmlXPathNodeSetCreate(cur);
if (keylist == NULL)
goto error;
- xmlHashAddEntry(table->keys, str, keylist);
+ if (xmlHashAddEntry(table->keys, str, keylist) < 0) {
+ xmlXPathFreeNodeSet(keylist);
+ goto error;
+ }
} else {
/*
* TODO: How do we know if this function failed?