Переглянути джерело

- fix for free_rdata_list() which used to access the "next" pointer after
freeing the current elements.
Credits & patch: Jan Andres <[email protected]>

Andrei Pelinescu-Onciul 19 роки тому
батько
коміт
54ff79d2aa
1 змінених файлів з 5 додано та 1 видалено
  1. 5 1
      resolve.c

+ 5 - 1
resolve.c

@@ -367,10 +367,14 @@ error:
 void free_rdata_list(struct rdata* head)
 {
 	struct rdata* l;
-	for(l=head; l; l=l->next){
+	struct rdata* next_l;
+	l=head;
+	while (l != 0) {
+		next_l = l->next;
 		/* free the parsed rdata*/
 		if (l->rdata) local_free(l->rdata);
 		local_free(l);
+		l = next_l;
 	}
 }