diff options
author | Antony Dovgal <tony2001@php.net> | 2006-09-05 11:24:49 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-09-05 11:24:49 +0000 |
commit | 8c53ff1e801a8127b24a4bd551613a3f4bd4bc8d (patch) | |
tree | 431cd615f3d0058e638ca14f925499155ea4bcec /ext/imap/php_imap.c | |
parent | c622ded86672eb6958794cc25629d9f4106dc74b (diff) | |
download | php-git-8c53ff1e801a8127b24a4bd551613a3f4bd4bc8d.tar.gz |
fix leak in imap_utf8(), avoid extra strlen() call
add test
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index dcaa200ead..a4e7b7ae0f 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2178,7 +2178,10 @@ PHP_FUNCTION(imap_utf8) cpytxt(&src, Z_STRVAL_PP(str), Z_STRLEN_PP(str)); utf8_mime2text(&src, &dest); - RETURN_STRINGL(dest.data, strlen(dest.data), 1); + RETVAL_STRINGL(dest.data, dest.size, 1); + if (dest.data) { + free(dest.data); + } } /* }}} */ |