From 073afa805d1654487a1ffc37055a6ed265ff142d Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 26 Feb 2024 19:13:57 +0000 Subject: [PATCH] Be clear about not leaking realloc --- string_pool.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/string_pool.cc b/string_pool.cc index ecf72f6d9..cc3484c6e 100644 --- a/string_pool.cc +++ b/string_pool.cc @@ -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);