1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-08 23:49:03 +00:00

Be clear about not leaking realloc

This commit is contained in:
dmiller
2024-02-26 19:13:57 +00:00
parent b73ab0bfff
commit 073afa805d

View File

@@ -158,8 +158,7 @@ const char *string_pool_sprintf(const char *fmt, ...)
size = 32;
/* Loop until we allocate a string big enough for the sprintf. */
for (;;) {
buf = (char *) realloc(buf, size);
assert(buf != NULL);
buf = (char *) safe_realloc(buf, size);
va_start(ap, fmt);
n = Vsnprintf(buf, size, fmt, ap);
va_end(ap);