about summary refs log tree commit diff
path: root/posix/tst-pathconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/tst-pathconf.c')
-rw-r--r--posix/tst-pathconf.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/posix/tst-pathconf.c b/posix/tst-pathconf.c
index 949fc65428..4f51ae8c2d 100644
--- a/posix/tst-pathconf.c
+++ b/posix/tst-pathconf.c
@@ -41,12 +41,7 @@ prepare (void)
   static const char dir_name[] = "/tst-pathconf.XXXXXX";
 
   size_t dirbuflen = test_dir_len + sizeof (dir_name);
-  dirbuf = malloc (dirbuflen);
-  if (dirbuf == NULL)
-    {
-      puts ("Out of memory");
-      exit (1);
-    }
+  dirbuf = xmalloc (dirbuflen);
 
   snprintf (dirbuf, dirbuflen, "%s%s", test_dir, dir_name);
   if (mkdtemp (dirbuf) == NULL)
@@ -73,7 +68,7 @@ do_test (void)
   static const char *fifo_name = "some-fifo";
 
   size_t filenamelen = strlen (dirbuf) + strlen (fifo_name) + 2;
-  char *filename = malloc (filenamelen);
+  char *filename = xmalloc (filenamelen);
 
   snprintf (filename, filenamelen, "%s/%s", dirbuf, fifo_name);