summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-01-10 02:58:25 +0000
committertjr <tjr@FreeBSD.org>2003-01-10 02:58:25 +0000
commit452c783e30a0c44e1737a6c96bb3557b0c3c1355 (patch)
treec8fe1b9f5137e82be6afca5f7fd3b69dadb01af8 /lib
parentb329764a9242e6bbeb0cfc49e68e47cdfba63c80 (diff)
downloadFreeBSD-src-452c783e30a0c44e1737a6c96bb3557b0c3c1355.zip
FreeBSD-src-452c783e30a0c44e1737a6c96bb3557b0c3c1355.tar.gz
Avoid a memory leak by using reallocf() instead of realloc().
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getcwd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c
index 0b318f5..1ca0efc 100644
--- a/lib/libc/gen/getcwd.c
+++ b/lib/libc/gen/getcwd.c
@@ -222,7 +222,7 @@ getcwd(pt, size)
}
off = bpt - pt;
len = ept - bpt;
- if ((pt = realloc(pt, ptsize *= 2)) == NULL)
+ if ((pt = reallocf(pt, ptsize *= 2)) == NULL)
goto err;
bpt = pt + off;
ept = pt + ptsize;
OpenPOWER on IntegriCloud