summary refs log tree commit diff
path: root/nptl/tst-cancel4.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/tst-cancel4.c')
-rw-r--r--nptl/tst-cancel4.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index 19e1baf9a9..d6d9f69f5f 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -2119,8 +2119,17 @@ do_test (void)
 	  close (tempfd2);
 	  tempfd2 = -1;
 	}
-      free (tempfname);
-      tempfname = NULL;
+      if (tempfname != NULL)
+	{
+	  unlink (tempfname);
+	  free (tempfname);
+	  tempfname = NULL;
+	}
+      if (tempmsg != -1)
+	{
+	  msgctl (tempmsg, IPC_RMID, NULL);
+	  tempmsg = -1;
+	}
     }
 
   for (cnt = 0; cnt < ntest_tf; ++cnt)