Author: chromatic
Date: Thu Oct  4 23:29:51 2007
New Revision: 21873

Modified:
   trunk/src/pmc/parrotio.pmc

Log:
[PMC] Free memory allocated earlier when taking early return path in open().
See r21868.

Modified: trunk/src/pmc/parrotio.pmc
==============================================================================
--- trunk/src/pmc/parrotio.pmc  (original)
+++ trunk/src/pmc/parrotio.pmc  Thu Oct  4 23:29:51 2007
@@ -68,8 +68,10 @@
         string_cstring_free(c_file);
         string_cstring_free(c_mode);
 
-        if (!pio || !PMC_struct_val(pio))
+        if (!pio || !PMC_struct_val(pio)) {
+            string_cstring_free(c_layer);
             return pmc_new(INTERP, enum_class_Undef);
+        }
 
         if (l) {
             ParrotIO * const io = (ParrotIO *)PMC_data(pio);

Reply via email to