]> sjero.net Git - wget/blobdiff - src/warc.c
Check for fclose errors.
[wget] / src / warc.c
index 24751dbf90d028471477aad0feb5af92f645b31d..69f80bebc62889edbf60c03bf60cddc2d6df50d5 100644 (file)
@@ -913,6 +913,12 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url,
           free (record_id);
         }
     }
+  else
+    {
+      xfree_null(checksum);
+      xfree_null(original_url);
+      xfree_null(record_id);
+    }
 }
 
 /* Loads the CDX file from opt.warc_cdx_dedup_filename and fills
@@ -1001,10 +1007,10 @@ warc_find_duplicate_cdx_record (char *url, char *sha1_digest_payload)
 
   char *key;
   struct warc_cdx_record *rec_existing;
-  hash_table_get_pair (warc_cdx_dedup_table, sha1_digest_payload, &key,
-                       &rec_existing);
+  int found = hash_table_get_pair (warc_cdx_dedup_table, sha1_digest_payload,
+                                   &key, &rec_existing);
 
-  if (rec_existing != NULL && strcmp (rec_existing->url, url) == 0)
+  if (found && strcmp (rec_existing->url, url) == 0)
     return rec_existing;
   else
     return NULL;