From 75e72a5e7b07c92dab8f84c7bf004c4a5297a656 Mon Sep 17 00:00:00 2001 From: Walter Karas Date: Wed, 12 May 2021 15:23:27 -0500 Subject: [PATCH] Eliminate next dup call using stale mime field mloc is s3_auth plugin. --- plugins/s3_auth/s3_auth.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/s3_auth/s3_auth.cc b/plugins/s3_auth/s3_auth.cc index d8d82449a56..3f47d8c6925 100644 --- a/plugins/s3_auth/s3_auth.cc +++ b/plugins/s3_auth/s3_auth.cc @@ -722,6 +722,7 @@ S3Request::set_header(const char *header, int header_len, const char *val, int v bool first = true; while (field_loc) { + tmp = TSMimeHdrFieldNextDup(_bufp, _hdr_loc, field_loc); if (first) { first = false; if (TS_SUCCESS == TSMimeHdrFieldValueStringSet(_bufp, _hdr_loc, field_loc, -1, val, val_len)) { @@ -730,7 +731,6 @@ S3Request::set_header(const char *header, int header_len, const char *val, int v } else { TSMimeHdrFieldDestroy(_bufp, _hdr_loc, field_loc); } - tmp = TSMimeHdrFieldNextDup(_bufp, _hdr_loc, field_loc); TSHandleMLocRelease(_bufp, _hdr_loc, field_loc); field_loc = tmp; }