From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 30 Oct 2011 16:17:07 +0000 (+0000)
Subject: In get_last_url(), add a missing check for strdup()'s return code
X-Git-Tag: v_3_0_18~64
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/developer-manual/man-page/faq/static/@default-cgi@show-status?a=commitdiff_plain;h=ecc7a9cf3f1f7bb3d1d97796c8b38ae274e71073;p=privoxy.git

In get_last_url(), add a missing check for strdup()'s return code
---

diff --git a/filters.c b/filters.c
index c4bfd9a7..54c2c6f4 100644
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.147 2011/10/30 16:15:43 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.148 2011/10/30 16:16:07 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -1131,6 +1131,12 @@ char *get_last_url(char *subject, const char *redirect_mode)
          {
             freez(found);
             found = strdup(h);
+            if (found == NULL)
+            {
+               log_error(LOG_LEVEL_ERROR,
+                  "Out of memory while searching for redirects.");
+               return NULL;
+            }
          }
          token = strtok(NULL, "?&");
       }