diff options
author | yang-g <yangg@google.com> | 2015-01-12 21:58:06 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-01-12 21:58:06 -0800 |
commit | d8532af01c00ea46431e21c6000a5f7fe44110ca (patch) | |
tree | 2af1a6992180fba904a761307615336f095c4d14 /src/core/support | |
parent | 472f60edac466843148fa46e7b18a972c85d5b64 (diff) | |
parent | 234ffbfd3969b31598ad8c062992472f18c37034 (diff) |
Merge pull request #4 from ctiller/vasprint
Fix compile: check return value for error
Diffstat (limited to 'src/core/support')
-rw-r--r-- | src/core/support/log_linux.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |