summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2009-11-21 16:42:06 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2009-11-21 16:42:06 +0000
commit7cfcf0ca0523919e75210dd5d90ebc250a452d70 (patch)
tree6b1e9339292059225ce25a62a3177fdd1d9a4f86 /lib/libc
parent91b2739663106702cefdf6e89a82db962c77addf (diff)
replacing malloc/realloc dance, by only one realloc
ok millert@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/glob.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index 7c6e8371807..0c48932e4f0 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: glob.c,v 1.28 2009/02/18 15:50:27 millert Exp $ */
+/* $OpenBSD: glob.c,v 1.29 2009/11/21 16:42:05 chl Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -714,8 +714,7 @@ globextend(const Char *path, glob_t *pglob, size_t *limitp)
const Char *p;
newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
- pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) :
- malloc(newsize);
+ pathv = realloc((char *)pglob->gl_pathv, newsize);
if (pathv == NULL) {
if (pglob->gl_pathv) {
free(pglob->gl_pathv);