about summary refs log tree commit diff
path: root/posix/tst-pathconf.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2016-06-11 14:50:16 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2016-06-11 14:50:16 -0700
commit850c67606e56e1a47fa0466e127f7b8ceda6ebe3 (patch)
tree0d8f4cf68b0d2792c7e5bcd420fd1d35f6ff3d35 /posix/tst-pathconf.c
parentb7a9b7b05b6c5b4da16975065e37d6e0b8401a6c (diff)
downloadglibc-850c67606e56e1a47fa0466e127f7b8ceda6ebe3.tar.gz
glibc-850c67606e56e1a47fa0466e127f7b8ceda6ebe3.tar.xz
glibc-850c67606e56e1a47fa0466e127f7b8ceda6ebe3.zip
2016-06-11 Paul Pluzhnikov <ppluzhnikov@google.com>
	[BZ #19670]
	[BZ #19672]

	* io/test-lfs.c (do_prepare): Use xmalloc.
	* io/tst-fcntl.c (do_prepare): Likewise.
	* libio/tst-fopenloc.c (do_bz17916): Likewise.
	* libio/tst-mmap2-eofsync.c (do_prepare): Likewise.
	* posix/tst-exec.c (do_prepare): Likewise.
	* posix/tst-pathconf.c (prepare): Likewise.
	* posix/tst-spawn.c (do_prepare): Likewise.
	* posix/tst-truncate.c (do_prepare): Likewise.
	* rt/tst-aio.c (do_prepare): Likewise.
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);