Skip to content

Commit

Permalink
Fixed an issue of lost dns_records (memleak and finally a cpu spinn);…
Browse files Browse the repository at this point in the history
… Thanks to Henrik Ramberg for his great assistance nailing it!
  • Loading branch information
gamelinux committed Sep 20, 2012
1 parent 818131f commit d7862b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/dns.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -760,11 +760,12 @@ void expire_dns_records()
if (pdnsr->next) if (pdnsr->next)
pdnsr->next->prev = pdnsr->prev; pdnsr->next->prev = pdnsr->prev;
pdns_record *tmp = pdnsr; pdns_record *tmp = pdnsr;
pdns_record *tmp_prev = pdnsr->prev;


pdnsr = pdnsr->next; pdnsr = pdnsr->next;


delete_dns_record(tmp, &dbucket[iter]); delete_dns_record(tmp, &dbucket[iter]);
if (pdnsr == NULL) { if (pdnsr == NULL && tmp_prev == NULL ) {
dbucket[iter] = NULL; dbucket[iter] = NULL;
} }
} else { } else {
Expand Down
2 changes: 1 addition & 1 deletion src/passivedns.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/* I N C L U D E S **********************************************************/ /* I N C L U D E S **********************************************************/


/* D E F I N E S ************************************************************/ /* D E F I N E S ************************************************************/
#define VERSION "0.5.0" #define VERSION "0.5.1"
#define TIMEOUT 60 #define TIMEOUT 60
#define BUCKET_SIZE 65536 #define BUCKET_SIZE 65536
#define SNAPLENGTH 1600 #define SNAPLENGTH 1600
Expand Down

0 comments on commit d7862b6

Please sign in to comment.