Browse code

- fix for free_rdata_list() which used to access the "next" pointer after freeing the current elements. Credits & patch: Jan Andres <jan.andres@freenet-ag.de>

Andrei Pelinescu-Onciul authored on 29/11/2006 14:35:05
Showing 1 changed files
... ...
@@ -367,10 +367,14 @@ error:
367 367
 void free_rdata_list(struct rdata* head)
368 368
 {
369 369
 	struct rdata* l;
370
-	for(l=head; l; l=l->next){
370
+	struct rdata* next_l;
371
+	l=head;
372
+	while (l != 0) {
373
+		next_l = l->next;
371 374
 		/* free the parsed rdata*/
372 375
 		if (l->rdata) local_free(l->rdata);
373 376
 		local_free(l);
377
+		l = next_l;
374 378
 	}
375 379
 }
376 380