From: Felipe Pena Date: Tue, 12 Nov 2013 22:55:39 +0000 (-0200) Subject: - Fix prototype and memory leak X-Git-Tag: php-5.6.0alpha1~110^2~410 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff54d20b583e41e996bdbf4c49b72919f3988f8b;p=php - Fix prototype and memory leak --- 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__)