com php-src: - Fix prototype and memory leak: phpdbg_utils. c phpdbg_utils.h
| From: | Bob Weinand | Date: | Tue, 12 Nov 2013 22:55:39 +0000 |
| Subject: | com php-src: - Fix prototype and memory leak: phpdbg_utils. c phpdbg_utils.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75051@lists.php.net to get a copy of this message | ||
Commit: ff54d20b583e41e996bdbf4c49b72919f3988f8b
Author: Felipe Pena <felipensp@gmail.com> Tue, 12 Nov 2013 20:55:39 -0200
Parents: 5d435cb8312c0e88d7feb38debb3bd319be35535
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ff54d20b583e41e996bdbf4c49b72919f3988f8b
Log:
- Fix prototype and memory leak
Changed paths:
M phpdbg_utils.c
M phpdbg_utils.h
Diff:
diff --git a/phpdbg_utils.c b/phpdbg_utils.c
index 01f2a3b..f37135f 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 cc3365a..432d6a0 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__)