From 234ffbfd3969b31598ad8c062992472f18c37034 Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Mon, 12 Jan 2015 15:09:34 -0800
Subject: [PATCH] Check return value for error

---
 src/core/support/log_linux.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/core/support/log_linux.c b/src/core/support/log_linux.c
index f3b528bdc4..36fb4b5051 100644
--- a/src/core/support/log_linux.c
+++ b/src/core/support/log_linux.c
@@ -54,7 +54,10 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
   char *message = NULL;
   va_list args;
   va_start(args, format);
-  vasprintf(&message, format, args);
+  if (vasprintf(&message, format, args) == -1) {
+    va_end(args);
+    return;
+  }
   va_end(args);
   gpr_log_message(file, line, severity, message);
   free(message);
-- 
GitLab