diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-05-06 15:18:17 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-05-06 15:18:17 +0400 |
commit | ebe024fd785fecfa23ab9e31754a3e2cd1d36bd7 (patch) | |
tree | 1687a7bd128ade2c2f8e89e3b9caddfd91e6b1d7 /ext/ftp/php_ftp.c | |
parent | 70a5e0e42981a2d38c9477741ab3242740034d47 (diff) | |
download | php-git-ebe024fd785fecfa23ab9e31754a3e2cd1d36bd7.tar.gz |
Fixed memory leaks
Diffstat (limited to 'ext/ftp/php_ftp.c')
-rw-r--r-- | ext/ftp/php_ftp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 47032ddd93..5f0e3a2646 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -553,7 +553,8 @@ PHP_FUNCTION(ftp_mkdir) { zval *z_ftp; ftpbuf_t *ftp; - char *dir, *tmp; + char *dir; + zend_string *tmp; int dir_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { @@ -568,7 +569,7 @@ PHP_FUNCTION(ftp_mkdir) RETURN_FALSE; } - RETURN_STRING(tmp); + RETURN_STR(tmp); } /* }}} */ @@ -629,7 +630,7 @@ PHP_FUNCTION(ftp_alloc) zval *z_ftp, *zresponse = NULL; ftpbuf_t *ftp; long size, ret; - char *response = NULL; + zend_string *response = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &z_ftp, &size, &zresponse) == FAILURE) { RETURN_FALSE; @@ -639,8 +640,9 @@ PHP_FUNCTION(ftp_alloc) ret = ftp_alloc(ftp, size, zresponse ? &response : NULL); if (response) { + ZVAL_DEREF(zresponse); zval_dtor(zresponse); - ZVAL_STRING(zresponse, response); + ZVAL_STR(zresponse, response); } if (!ret) { |