Formalize buffer var allocations
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index 6e1757a..e5edb3c 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -34,7 +34,7 @@
 HB_BEGIN_DECLS
 
 
-/* buffer var allocations */
+/* buffer **position** var allocations */
 #define attach_lookback() var.u16[0] /* number of glyphs to go back to attach this glyph to its base */
 #define cursive_chain() var.i16[1] /* character to which this connects, may be positive or negative */
 
@@ -1569,6 +1569,10 @@
 GPOS::position_start (hb_buffer_t *buffer)
 {
   buffer->clear_positions ();
+
+  unsigned int count = buffer->len;
+  for (unsigned int i = 0; i < count; i++)
+    buffer->pos[i].attach_lookback() = buffer->pos[i].cursive_chain() = 0;
 }
 
 void
@@ -1580,15 +1584,15 @@
 
   /* Handle cursive connections */
   for (unsigned int i = 0; i < len; i++)
-  {
     fix_cursive_minor_offset (pos, i, direction);
-  }
 
   /* Handle attachments */
   for (unsigned int i = 0; i < len; i++)
-  {
     fix_mark_attachment (pos, i, direction);
-  }
+
+  HB_BUFFER_DEALLOCATE_VAR (buffer, lig_comp);
+  HB_BUFFER_DEALLOCATE_VAR (buffer, lig_id);
+  HB_BUFFER_DEALLOCATE_VAR (buffer, props_cache);
 }