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

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


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

commit a70a2c424c1959fe0968613680327ef58478f687
Author: Walt Karas <[email protected]>
AuthorDate: Wed May 12 17:42:47 2021 -0500

    Eliminate next dup call using stale mime field mloc is s3_auth plugin. 
(#7825)
    
    (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 696fcab..9e10263 100644
--- a/plugins/s3_auth/s3_auth.cc
+++ b/plugins/s3_auth/s3_auth.cc
@@ -597,6 +597,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)) {
@@ -605,7 +606,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