summaryrefslogtreecommitdiff
path: root/ext/syck/handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/syck/handler.c')
-rw-r--r--ext/syck/handler.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
index 0a7ee8c10f..ca15fd03a2 100644
--- a/ext/syck/handler.c
+++ b/ext/syck/handler.c
@@ -1,5 +1,5 @@
/*
- * handler.h
+ * handler.c
*
* $Author$
* $Date$
@@ -73,6 +73,7 @@ syck_hdlr_get_anchor( SyckParser *p, char *a )
{
if ( n != (void *)1 )
{
+ S_FREE( a );
return n;
}
else
@@ -94,7 +95,16 @@ syck_hdlr_get_anchor( SyckParser *p, char *a )
{
n = (p->bad_anchor_handler)( p, a );
}
- n->anchor = a;
+
+ if ( n->anchor )
+ {
+ S_FREE( a );
+ }
+ else
+ {
+ n->anchor = a;
+ }
+
return n;
}