summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Fuhrmannek2016-10-12 10:46:15 +0200
committerBen Fuhrmannek2016-10-12 10:46:15 +0200
commit1a2cb68a847f08f934aba2b256a3098fdfae81df (patch)
tree9c8a98dfbcd3efd384bebaac4da372eff8ab3128
parent822727069733a0c786b1b5adf0512ca33183d6e3 (diff)
fixed missing free in error case (#104)
-rw-r--r--rfc1867_new.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rfc1867_new.c b/rfc1867_new.c
index 3295375..73da611 100644
--- a/rfc1867_new.c
+++ b/rfc1867_new.c
@@ -439,13 +439,14 @@ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header T
439 newlines = 0; 439 newlines = 0;
440 440
441 } else if (buf_value.c) { /* If no ':' on the line, add to previous line */ 441 } else if (buf_value.c) { /* If no ':' on the line, add to previous line */
442 smart_str_appends(&buf_value, line);
443 newlines++; 442 newlines++;
444 if (newlines > SUHOSIN_G(upload_max_newlines)) { 443 if (newlines > SUHOSIN_G(upload_max_newlines)) {
445 SUHOSIN_G(abort_request) = 1; 444 SUHOSIN_G(abort_request) = 1;
446 suhosin_log(S_FILES, "configured maximum number of newlines in RFC1867 MIME headers limit exceeded - dropping rest of upload"); 445 suhosin_log(S_FILES, "configured maximum number of newlines in RFC1867 MIME headers limit exceeded - dropping rest of upload");
446 smart_str_free(&buf_value);
447 return 0; 447 return 0;
448 } 448 }
449 smart_str_appends(&buf_value, line);
449 450
450 } else { 451 } else {
451 continue; 452 continue;