diff options
author | obrien <obrien@FreeBSD.org> | 2003-01-06 17:11:46 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2003-01-06 17:11:46 +0000 |
commit | 77b391761d0fd606e71c109f672d53f941b48599 (patch) | |
tree | 9ca94a2b4eb5c81ff9641666bf64ebae7d4332d5 /usr.sbin/sysinstall | |
parent | 9f25f73de677c6374cdfcddf394093fad7170c96 (diff) | |
download | FreeBSD-src-77b391761d0fd606e71c109f672d53f941b48599.zip FreeBSD-src-77b391761d0fd606e71c109f672d53f941b48599.tar.gz |
save_realloc() should use reallocf() to close memory leaks.
item_add() should use safe_realloc() as it does no error checking itself.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c index e485234..07cbc81 100644 --- a/usr.sbin/sysinstall/misc.c +++ b/usr.sbin/sysinstall/misc.c @@ -206,7 +206,7 @@ safe_realloc(void *orig, size_t size) if (size <= 0) msgFatal("Invalid realloc size of %ld!", (long)size); - ptr = realloc(orig, size); + ptr = reallocf(orig, size); if (!ptr) msgFatal("Out of memory!"); return ptr; @@ -243,7 +243,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title, if (*curr == *max) { *max += 20; - list = (dialogMenuItem *)realloc(list, sizeof(dialogMenuItem) * *max); + list = (dialogMenuItem *)safe_realloc(list, sizeof(dialogMenuItem) * *max); } d = &list[(*curr)++]; bzero(d, sizeof(*d)); |