]> granicus.if.org Git - php/commitdiff
MFH: Fixed crash + leak
authorfoobar <sniper@php.net>
Thu, 30 Dec 2004 05:33:53 +0000 (05:33 +0000)
committerfoobar <sniper@php.net>
Thu, 30 Dec 2004 05:33:53 +0000 (05:33 +0000)
ext/imap/php_imap.c

index f68cc260f7e8dad6c23c266a1d4a5be16782c5b9..e51ca880642355b2a1b5ead5e809966152211223 100644 (file)
@@ -2951,7 +2951,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) {
@@ -3164,9 +3164,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);
 }
 /* }}} */