diff options
author | imp <imp@FreeBSD.org> | 1998-09-16 04:17:47 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1998-09-16 04:17:47 +0000 |
commit | bfe73fd683053201c326f9ff2c8e5e0f69cc7fe7 (patch) | |
tree | b17d45198953bfbbad4bfd632dfdf1a37b7159d2 /lib/libc/gen/fts-compat.c | |
parent | 68a8c771724d4fc671cac3ce95f78d4fb1874cfe (diff) | |
download | FreeBSD-src-bfe73fd683053201c326f9ff2c8e5e0f69cc7fe7.zip FreeBSD-src-bfe73fd683053201c326f9ff2c8e5e0f69cc7fe7.tar.gz |
Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is
guaranteed to be the same thing.
I've been running these on my system here w/o ill effects for some
time. However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes. Shouldn't impact anything, but...
Diffstat (limited to 'lib/libc/gen/fts-compat.c')
-rw-r--r-- | lib/libc/gen/fts-compat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index 02cad6c..da88ed1 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -881,7 +881,7 @@ fts_sort(sp, head, nitems) */ if (nitems > sp->fts_nitems) { sp->fts_nitems = nitems + 40; - if ((sp->fts_array = realloc(sp->fts_array, + if ((sp->fts_array = reallocf(sp->fts_array, (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) { sp->fts_nitems = 0; return (head); @@ -959,7 +959,7 @@ fts_palloc(sp, more) size_t more; { sp->fts_pathlen += more + 256; - sp->fts_path = realloc(sp->fts_path, (size_t)sp->fts_pathlen); + sp->fts_path = reallocf(sp->fts_path, (size_t)sp->fts_pathlen); return (sp->fts_path == NULL); } |