]> git.imager.perl.org - imager.git/blobdiff - error.c
update skip count
[imager.git] / error.c
diff --git a/error.c b/error.c
index dd6b94f324b38c5a01d611925da43b04204cd8c4..1737bc421f4fa428f65043bbb1300b98a58ec27e 100644 (file)
--- a/error.c
+++ b/error.c
@@ -186,6 +186,17 @@ Called by any imager function before doing any other processing.
 
 =cut */
 void i_clear_error() {
+#ifdef IMAGER_DEBUG_MALLOC
+  int i;
+
+  for (i = 0; i < ERRSTK; ++i) {
+    if (error_space[i]) {
+      myfree(error_stack[i].msg);
+      error_stack[i].msg = NULL;
+      error_space[i] = 0;
+    }
+  }
+#endif
   error_sp = ERRSTK-1;
 }