forked from cory/tildefriends
Prefer tf_resize_vec many places over tf_realloc.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4805 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -456,7 +456,7 @@ static void _httpd_endpoint_mem(tf_http_request_t* request)
|
||||
{
|
||||
const char* stack = tf_util_backtrace_to_string(alloc[i].frames, alloc[i].frames_count);
|
||||
int line = snprintf(NULL, 0, "%zd bytes in %d allocations\n%s\n\n", alloc[i].size, alloc[i].count, stack);
|
||||
response = tf_realloc(response, length + line);
|
||||
response = tf_resize_vec(response, length + line);
|
||||
snprintf(response + length, line, "%zd bytes in %d allocations\n%s\n\n", alloc[i].size, alloc[i].count, stack);
|
||||
length += line - 1;
|
||||
tf_free((void*)stack);
|
||||
|
Reference in New Issue
Block a user