Index: libyaml/trunk/src/parser.c
===================================================================
--- libyaml/trunk/src/parser.c	(revision 208)
+++ libyaml/trunk/src/parser.c	(revision 210)
@@ -364,4 +364,6 @@
             assert(1);      /* Invalid state. */
     }
+
+    return 0;
 }
 
@@ -1359,9 +1361,13 @@
         if (STACK_EMPTY(parser, tag_directives)) {
             *tag_directives_start_ref = *tag_directives_end_ref = NULL;
+            STACK_DEL(parser, tag_directives);
         }
         else {
             *tag_directives_start_ref = tag_directives.start;
-            *tag_directives_end_ref = tag_directives.end;
-        }
+            *tag_directives_end_ref = tag_directives.top;
+        }
+    }
+    else {
+        STACK_DEL(parser, tag_directives);
     }
 
@@ -1385,5 +1391,4 @@
     yaml_tag_directive_t *tag_directive;
     yaml_tag_directive_t copy = { NULL, NULL };
-    int length;
 
     for (tag_directive = parser->tag_directives.start;
