diff options
author | tjr <tjr@FreeBSD.org> | 2003-01-10 02:58:25 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-01-10 02:58:25 +0000 |
commit | 452c783e30a0c44e1737a6c96bb3557b0c3c1355 (patch) | |
tree | c8fe1b9f5137e82be6afca5f7fd3b69dadb01af8 /lib/libc | |
parent | b329764a9242e6bbeb0cfc49e68e47cdfba63c80 (diff) | |
download | FreeBSD-src-452c783e30a0c44e1737a6c96bb3557b0c3c1355.zip FreeBSD-src-452c783e30a0c44e1737a6c96bb3557b0c3c1355.tar.gz |
Avoid a memory leak by using reallocf() instead of realloc().
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/getcwd.c | 2 |
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; |