Sarathy's clear_pmop patch with Radu Greab's fix,
[p5sagit/p5-mst-13.2.git] / vms / vms.c
index 43a5c22..7915679 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -1732,6 +1732,18 @@ struct _pipeloc {
 };
 static pPLOC  head_PLOC = 0;
 
+void
+free_pipelocs(void *head)
+{
+    pPLOC p, pnext;
+
+    p = (pPLOC) head;
+    while (p) {
+        pnext = p->next;
+        Safefree(p);
+        p = pnext;
+    }
+}
 
 static void
 store_pipelocs()
@@ -1798,7 +1810,7 @@ store_pipelocs()
         p->dir[NAM$C_MAXRSS] = '\0';
     }
 #endif
-
+    Perl_call_atexit(&free_pipelocs, head_PLOC);
 }