mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
- MFH: #47940, leaks in imap_body()
This commit is contained in:
parent
b6672146b0
commit
c20e1537cf
@ -1575,6 +1575,8 @@ PHP_FUNCTION(imap_body)
|
||||
long msgno, flags = 0;
|
||||
pils *imap_le_struct;
|
||||
int msgindex, argc = ZEND_NUM_ARGS();
|
||||
char *body;
|
||||
unsigned long body_len = 0;
|
||||
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
|
||||
return;
|
||||
@ -1600,7 +1602,13 @@ PHP_FUNCTION(imap_body)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETVAL_STRING(mail_fetchtext_full(imap_le_struct->imap_stream, msgno, NIL, (argc == 3 ? flags : NIL)), 1);
|
||||
body = mail_fetchtext_full (imap_le_struct->imap_stream, msgno, &body_len, (argc == 3 ? flags : NIL));
|
||||
if (body_len == 0) {
|
||||
RETVAL_EMPTY_STRING();
|
||||
} else {
|
||||
RETVAL_STRINGL(body, body_len, 1);
|
||||
}
|
||||
free(body);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user