From 1a2cb68a847f08f934aba2b256a3098fdfae81df Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Wed, 12 Oct 2016 10:46:15 +0200 Subject: fixed missing free in error case (#104) --- rfc1867_new.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 newlines = 0; } else if (buf_value.c) { /* If no ':' on the line, add to previous line */ - smart_str_appends(&buf_value, line); newlines++; if (newlines > SUHOSIN_G(upload_max_newlines)) { SUHOSIN_G(abort_request) = 1; suhosin_log(S_FILES, "configured maximum number of newlines in RFC1867 MIME headers limit exceeded - dropping rest of upload"); + smart_str_free(&buf_value); return 0; } + smart_str_appends(&buf_value, line); } else { continue; -- cgit v1.3