From 853f2aaf0c8d97fd2c62aca11cd5645e0305311d Mon Sep 17 00:00:00 2001 From: foobar Date: Thu, 30 Dec 2004 05:33:26 +0000 Subject: [PATCH] MFH: Fixed crash + leak --- ext/imap/php_imap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index bfc557ebfa..9d7958ebba 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2980,7 +2980,7 @@ PHP_FUNCTION(imap_mail_compose) bod->contents.text.size = Z_STRLEN_PP(pvalue); } else { bod->contents.text.data = (char *) fs_get(1); - bod->contents.text.data = ""; + memcpy(bod->contents.text.data, "", 1); bod->contents.text.size = 0; } if (zend_hash_find(Z_ARRVAL_PP(data), "lines", sizeof("lines"), (void **) &pvalue)== SUCCESS) { @@ -3193,9 +3193,7 @@ PHP_FUNCTION(imap_mail_compose) RETVAL_STRING(tempstring, 0); done: -#if ilia_0 /* this should be done, otherwise we leak memory. Unfortunately this seems to cause a crash in some cases */ mail_free_body(&topbod); -#endif mail_free_envelope(&env); } /* }}} */ -- 2.50.1