]> granicus.if.org Git - php/commitdiff
- Fix prototype and memory leak
authorFelipe Pena <felipensp@gmail.com>
Tue, 12 Nov 2013 22:55:39 +0000 (20:55 -0200)
committerFelipe Pena <felipensp@gmail.com>
Tue, 12 Nov 2013 22:55:39 +0000 (20:55 -0200)
phpdbg_utils.c
phpdbg_utils.h

index 01f2a3b6ac07125ff1032820fea220782728458f..f37135f69c07c901077209fa7e98f6feb0ae85b7 100644 (file)
@@ -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);
+       }
 } /* }}} */
index cc3365a603bb0f02c03259560c4e3b67c6837fd2..432d6a0b22e93d96879af7d6556b5c08e481edc1 100644 (file)
@@ -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__)