---
 src/ChangeLog | 5 +++++
 src/cookies.c | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 4a2b1b9..c0d6466 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
 2014-11-22  Darshit Shah  <[email protected]>
 
+       * cookies.c (discard_matching_cookie): Replace defensive assert with a
+       logical check and error message
+
+2014-11-22  Darshit Shah  <[email protected]>
+
        * wget.h: Make extern declaration for program_argstring.
        * warc.c: Remove extern declaration
        * test.c: Make program_argstring a char *, instead of const char *.
diff --git a/src/cookies.c b/src/cookies.c
index 365f8d5..aaec52b 100644
--- a/src/cookies.c
+++ b/src/cookies.c
@@ -304,7 +304,13 @@ discard_matching_cookie (struct cookie_jar *jar, struct 
cookie *cookie)
 
           res = hash_table_get_pair (jar->chains, victim->domain,
                                      &chain_key, NULL);
-          assert (res != 0);
+
+          if (res == 0)
+            {
+              logprintf (LOG_VERBOSE, _("Unable to get cookie for %s"),
+                         victim->domain);
+              DEBUGP(("Cookie details not found in Hash Table."));
+            }
           if (!victim->next)
             {
               /* VICTIM was the only cookie in the chain.  Destroy the
-- 
2.1.3


Reply via email to