Skip to content

Commit

Permalink
- Fixed the crash and leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
foobar committed Dec 30, 2004
1 parent f47d6bc commit 57eddbd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ext/imap/php_imap.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -3194,9 +3194,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);
}
/* }}} */
Expand Down

0 comments on commit 57eddbd

Please sign in to comment.