From b206c154dd7605bf0dbdc7a69605b6f749d2bef4 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" <pixel@nobis-crew.org> Date: Fri, 8 Apr 2016 19:42:28 +0200 Subject: [PATCH] Addressing comment. --- src/core/lib/profiling/basic_timers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/lib/profiling/basic_timers.c b/src/core/lib/profiling/basic_timers.c index 0a4ae3057a..50082cd7ee 100644 --- a/src/core/lib/profiling/basic_timers.c +++ b/src/core/lib/profiling/basic_timers.c @@ -173,7 +173,7 @@ static void flush_logs(gpr_timer_log_list *list) { gpr_timer_log *log; while ((log = timer_log_pop_front(list)) != NULL) { write_log(log); - gpr_free(log); + free(log); } } @@ -208,7 +208,8 @@ static void init_output() { } static void rotate_log() { - gpr_timer_log *new = gpr_malloc(sizeof(*new)); + /* Using malloc here, as this code could end up being called by gpr_malloc */ + gpr_timer_log *new = malloc(sizeof(*new)); gpr_once_init(&g_once_init, init_output); new->num_entries = 0; pthread_mutex_lock(&g_mu); -- GitLab