[nginx] Perl: fixed warning about "sep" may be used uninitialized.

Maxim Dounin mdounin at mdounin.ru
Tue Aug 18 13:26:58 UTC 2015


details:   http://hg.nginx.org/nginx/rev/5f2a0739da19
branches:  
changeset: 6232:5f2a0739da19
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Tue Aug 18 16:26:05 2015 +0300
description:
Perl: fixed warning about "sep" may be used uninitialized.

diffstat:

 src/http/modules/perl/nginx.xs |  15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diffs (28 lines):

diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -268,18 +268,15 @@ header_in(r, key)
         }
 #endif
 
-        if (hh->offset) {
+        ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset);
 
-            ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset);
+        if (*ph) {
+            ngx_http_perl_set_targ((*ph)->value.data, (*ph)->value.len);
 
-            if (*ph) {
-                ngx_http_perl_set_targ((*ph)->value.data, (*ph)->value.len);
+            goto done;
+        }
 
-                goto done;
-            }
-
-            XSRETURN_UNDEF;
-        }
+        XSRETURN_UNDEF;
 
     multi:
 



More information about the nginx-devel mailing list