summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-09-21 11:21:46 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-09-21 11:25:46 +0200
commit730fdc77a74ce4816cfb10181357e3eee92e2d3b (patch)
tree75a708b00de5500ca565795bbe81f7757b19d637
parent81b2f3e5d9fcdffd87a4fcd12bd8c708a97091e1 (diff)
downloadphp-git-730fdc77a74ce4816cfb10181357e3eee92e2d3b.tar.gz
Fix memory leak in php_imap_mutf7()
We have to free the string which has been allocated by libc-client.
-rw-r--r--ext/imap/php_imap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 01d1a5f80c..5511b2c1c4 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -3074,7 +3074,8 @@ static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
if (out == NIL) {
RETURN_FALSE;
} else {
- RETURN_STRING((char *)out);
+ RETVAL_STRING((char *)out);
+ fs_give((void**) &out);
}
}
/* }}} */