summaryrefslogtreecommitdiffstats
path: root/lib/libc/db/btree/bt_overflow.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-03-05 00:57:01 +0000
committerdelphij <delphij@FreeBSD.org>2009-03-05 00:57:01 +0000
commit02654885c3218680f7784a94dec913420f7a033e (patch)
treedca880f0029284c8bf3480757527c76481cbab7e /lib/libc/db/btree/bt_overflow.c
parent1b605ed6f8f06715dccab8708ba5d26251cde30a (diff)
downloadFreeBSD-src-02654885c3218680f7784a94dec913420f7a033e.zip
FreeBSD-src-02654885c3218680f7784a94dec913420f7a033e.tar.gz
Our realloc(3) and reallocf(3) can handle NULL, which turns it into a
malloc(3) call, so don't test if a pointer is NULL. Obtained from: OpenBSD (in spirit)
Diffstat (limited to 'lib/libc/db/btree/bt_overflow.c')
-rw-r--r--lib/libc/db/btree/bt_overflow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/db/btree/bt_overflow.c b/lib/libc/db/btree/bt_overflow.c
index e618c8c..266d599 100644
--- a/lib/libc/db/btree/bt_overflow.c
+++ b/lib/libc/db/btree/bt_overflow.c
@@ -92,7 +92,7 @@ __ovfl_get(BTREE *t, void *p, size_t *ssz, void **buf, size_t *bufsz)
#endif
/* Make the buffer bigger as necessary. */
if (*bufsz < sz) {
- *buf = (char *)(*buf == NULL ? malloc(sz) : reallocf(*buf, sz));
+ *buf = reallocf(*buf, sz);
if (*buf == NULL)
return (RET_ERROR);
*bufsz = sz;
OpenPOWER on IntegriCloud