From ff54d20b583e41e996bdbf4c49b72919f3988f8b Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Tue, 12 Nov 2013 20:55:39 -0200 Subject: [PATCH] - Fix prototype and memory leak --- phpdbg_utils.c | 6 +++++- phpdbg_utils.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/phpdbg_utils.c b/phpdbg_utils.c index 01f2a3b6ac..f37135f69c 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -70,7 +70,7 @@ int phpdbg_is_class_method(const char *str, size_t len, char **class, char **met return 1; } /* }}} */ -int phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */ +void phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */ { char *buffer = NULL; va_list args; @@ -94,4 +94,8 @@ int phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */ PHPDBG_END_LINE(TSRMLS_D)); break; } + + if (buffer) { + efree(buffer); + } } /* }}} */ diff --git a/phpdbg_utils.h b/phpdbg_utils.h index cc3365a603..432d6a0b22 100644 --- a/phpdbg_utils.h +++ b/phpdbg_utils.h @@ -38,7 +38,7 @@ enum { NOTICE }; -int phpdbg_print(int TSRMLS_DC, const char*, ...); +void phpdbg_print(int TSRMLS_DC, const char*, ...); #define phpdbg_error(fmt, ...) phpdbg_print(ERROR TSRMLS_CC, fmt, ##__VA_ARGS__) #define phpdbg_notice(fmt, ...) phpdbg_print(NOTICE TSRMLS_CC, fmt, ##__VA_ARGS__) -- 2.40.0