]> git.pld-linux.org Git - packages/pound.git/commitdiff
- just in case: do not free(NULL)
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 9 Dec 2011 19:29:17 +0000 (19:29 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    MultipleAddHeaderHonored.diff -> 1.2

MultipleAddHeaderHonored.diff

index 9e10341114c4060f92e0d22aa6a54385186f4ae8..1eef222e255bb144b665f16c980c2c94ba2d3452 100644 (file)
@@ -38,8 +38,8 @@ Francisco Ruiz
 francisco.ruiz(at)juntaextremadura.es
 
 Ahorrar papel protege el medio ambiente
---- config.c.orig      2010-02-02 12:49:02.000000000 +0100
-+++ config.c   2011-11-14 21:52:49.000000000 +0100
+--- Pound-2.5/config.c 2011-12-09 21:06:52.351470209 +0200
++++ Pound-2.5/config.c 2011-12-09 21:06:52.351470209 +0200
 @@ -625,6 +625,7 @@
  parse_HTTP(void)
  {
@@ -48,7 +48,7 @@ Ahorrar papel protege el medio ambiente
      LISTENER    *res;
      SERVICE     *svc;
      MATCHER     *m;
-@@ -719,8 +720,18 @@
+@@ -719,8 +720,19 @@
                  conf_err("HeadRemove bad pattern - aborted");
          } else if(!regexec(&AddHeader, lin, 4, matches, 0)) {
              lin[matches[1].rm_eo] = '\0';
@@ -64,12 +64,13 @@ Ahorrar papel protege el medio ambiente
 +                  conf_err("AddHeader config: out of memory - aborted");
 +              sprintf(ah, "%s\r\n%s", res->add_head, lin + matches[1].rm_so);
 +            }
-+            free(res->add_head);
++            if (res->add_head)
++               free(res->add_head);
 +            res->add_head = ah;
          } else if(!regexec(&RewriteLocation, lin, 4, matches, 0)) {
              res->rewr_loc = atoi(lin + matches[1].rm_so);
          } else if(!regexec(&RewriteDestination, lin, 4, matches, 0)) {
-@@ -772,6 +783,7 @@
+@@ -772,6 +785,7 @@
  parse_HTTPS(void)
  {
      char        lin[MAXBUF];
@@ -77,7 +78,7 @@ Ahorrar papel protege el medio ambiente
      LISTENER    *res;
      SERVICE     *svc;
      MATCHER     *m;
-@@ -902,8 +914,18 @@
+@@ -902,8 +916,19 @@
              }
          } else if(!regexec(&AddHeader, lin, 4, matches, 0)) {
              lin[matches[1].rm_eo] = '\0';
@@ -93,13 +94,14 @@ Ahorrar papel protege el medio ambiente
 +                  conf_err("AddHeader config: out of memory - aborted");
 +              sprintf(ah, "%s\r\n%s", res->add_head, lin + matches[1].rm_so);
 +            }
-+            free(res->add_head);
++            if (res->add_head)
++               free(res->add_head);
 +            res->add_head = ah;
          } else if(!regexec(&Ciphers, lin, 4, matches, 0)) {
              lin[matches[1].rm_eo] = '\0';
              SSL_CTX_set_cipher_list(res->ctx, lin + matches[1].rm_so);
---- pound.h.orig       2010-02-02 12:49:02.000000000 +0100
-+++ pound.h    2011-11-15 21:40:40.000000000 +0100
+--- ./pound.h.orig     2010-02-02 12:49:02.000000000 +0100
++++ ./pound.h  2011-11-15 21:40:40.000000000 +0100
 @@ -354,7 +354,7 @@
      SSL_CTX             *ctx;       /* CTX for SSL connections */
      int                 clnt_check; /* client verification mode */
@@ -109,8 +111,8 @@ Ahorrar papel protege el medio ambiente
      regex_t             verb;       /* pattern to match the request verb against */
      int                 to;         /* client time-out */
      int                 has_pat;    /* was a URL pattern defined? */
---- pound.8.orig       2010-02-02 12:49:02.000000000 +0100
-+++ pound.8    2011-11-15 21:48:02.000000000 +0100
+--- ./pound.8.orig     2010-02-02 12:49:02.000000000 +0100
++++ ./pound.8  2011-11-15 21:48:02.000000000 +0100
 @@ -405,7 +405,7 @@
  .TP
  \fBAddHeader\fR "header: to add"
This page took 0.277211 seconds and 4 git commands to generate.