Permalink
Browse files

Fixed an issue of lost dns_records (memleak and finally a cpu spinn);…

… Thanks to Henrik Ramberg for his great assistance nailing it!
  • Loading branch information...
1 parent 818131f commit d7862b67dd77c1526ab3a57330d01be7e5ac7115 gamelinux committed Sep 20, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 src/dns.c
  2. +1 −1 src/passivedns.h
View
@@ -760,11 +760,12 @@ void expire_dns_records()
if (pdnsr->next)
pdnsr->next->prev = pdnsr->prev;
pdns_record *tmp = pdnsr;
+ pdns_record *tmp_prev = pdnsr->prev;
pdnsr = pdnsr->next;
delete_dns_record(tmp, &dbucket[iter]);
- if (pdnsr == NULL) {
+ if (pdnsr == NULL && tmp_prev == NULL ) {
dbucket[iter] = NULL;
}
} else {
View
@@ -22,7 +22,7 @@
/* I N C L U D E S **********************************************************/
/* D E F I N E S ************************************************************/
-#define VERSION "0.5.0"
+#define VERSION "0.5.1"
#define TIMEOUT 60
#define BUCKET_SIZE 65536
#define SNAPLENGTH 1600

0 comments on commit d7862b6

Please sign in to comment.