php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #74233
Patch free-memory-about-content-disposition revision 2017-03-13 07:24 UTC by naoki-kawamukai at cybozu dot co dot jp

Patch free-memory-about-content-disposition for mailparse Bug #74233

Patch version 2017-03-13 07:24 UTC

Return to Bug #74233 | Download this patch
Patch Revisions:

Developer: naoki-kawamukai@cybozu.co.jp

diff --git php_mailparse_mime.c php_mailparse_mime.c
index 0cc7ff6..51125f8 100644
--- php_mailparse_mime.c
+++ php_mailparse_mime.c
@@ -493,6 +493,10 @@ static int php_mimepart_process_header(php_mimepart *part)
 			}
 		}
 		if (strcmp(header_key, "content-disposition") == 0) {
+			if (part->content_disposition) {
+				php_mimeheader_free(part->content_disposition);
+				part->content_disposition = NULL;
+			}
 			part->content_disposition = php_mimeheader_alloc_from_tok(toks);
 		}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC