This is an automated email from the ASF dual-hosted git repository.

eze pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.1.x by this push:
     new a8048f7  Eliminate next dup call using stale mime field mloc is 
s3_auth plugin. (#7825) (#7860)
a8048f7 is described below

commit a8048f7bdb18512e89493026d990a0b52c7008d6
Author: Walt Karas <[email protected]>
AuthorDate: Wed May 19 15:03:08 2021 -0500

    Eliminate next dup call using stale mime field mloc is s3_auth plugin. 
(#7825) (#7860)
    
    (cherry picked from commit f8ddad16c3be2e142c8f6782449fda35e0020318)
---
 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 242d5fe..12edccc 100644
--- a/plugins/s3_auth/s3_auth.cc
+++ b/plugins/s3_auth/s3_auth.cc
@@ -592,6 +592,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)) {
@@ -600,7 +601,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;
     }

Reply via email to