diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-12 17:28:24 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-13 13:09:29 +0200 |
commit | 9c7b6073203ed3db749c26e88d4f0c2514a60101 (patch) | |
tree | 72cd7830f7142ad2238f79ff23f25606a1ebd9b4 | |
parent | 8782c61f262a4c00a09b489783ea564667ccdf0e (diff) | |
download | php-git-9c7b6073203ed3db749c26e88d4f0c2514a60101.tar.gz |
Ignore memory leaks reported for some libc-client functions
At least on Windows, some static variables are lazily initialized
during `mail_open()` and `mail_lsub()`, which are reported as memory
leaks. We suppress these false positives.
Closes GH-6326.
-rw-r--r-- | ext/imap/php_imap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 8c74c8b29a..6a7cfe7037 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1257,7 +1257,9 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) } #endif + ZEND_IGNORE_LEAKS_BEGIN(); imap_stream = mail_open(NIL, ZSTR_VAL(mailbox), flags); + ZEND_IGNORE_LEAKS_END(); if (imap_stream == NIL) { php_error_docref(NULL, E_WARNING, "Couldn't open stream %s", ZSTR_VAL(mailbox)); @@ -2227,7 +2229,9 @@ PHP_FUNCTION(imap_lsub) IMAPG(folderlist_style) = FLIST_ARRAY; IMAPG(imap_sfolders) = NIL; + ZEND_IGNORE_LEAKS_BEGIN(); mail_lsub(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat)); + ZEND_IGNORE_LEAKS_END(); if (IMAPG(imap_sfolders) == NIL) { RETURN_FALSE; } @@ -2266,7 +2270,9 @@ PHP_FUNCTION(imap_lsub_full) IMAPG(folderlist_style) = FLIST_OBJECT; IMAPG(imap_sfolder_objects) = IMAPG(imap_sfolder_objects_tail) = NIL; + ZEND_IGNORE_LEAKS_BEGIN(); mail_lsub(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat)); + ZEND_IGNORE_LEAKS_END(); if (IMAPG(imap_sfolder_objects) == NIL) { RETURN_FALSE; } |