Author: julianalbo
Date: Mon Jan 26 15:58:21 2009
New Revision: 36041

Modified:
   trunk/src/exceptions.c

Log:
fix some problems in Parrot_print_backtrace

Modified: trunk/src/exceptions.c
==============================================================================
--- trunk/src/exceptions.c      (original)
+++ trunk/src/exceptions.c      Mon Jan 26 15:58:21 2009
@@ -598,10 +598,14 @@
 #  else
     { /* Scope for strings */
         char ** strings = backtrace_symbols(array, size);
-        for (i = 0; i < size; i++)
-            fprintf(stderr, "%s\n", strings[i]);
-
-        mem_sys_free(strings);
+        if (strings) {
+            for (i = 0; i < size; i++)
+                fprintf(stderr, "%s\n", strings[i]);
+            /* backtrace_symbols gets memory using malloc */
+            free(strings);
+        }
+        else
+            fputs("Not enough memory for backtrace_symbols\n", stderr);
     }
 #  endif
 

Reply via email to