ref: 7fd9be0f083255f04377024b0518e14c26f1f985
parent: 97c6a1dd521c893de2c26b8876cdda283fdd7dc8
author: cinap_lenrek <[email protected]>
date: Wed Aug 18 15:37:44 EDT 2021
snoopy: ... and fix the memory leak for new dns rr types
--- a/sys/src/cmd/ip/snoopy/dns.c
+++ b/sys/src/cmd/ip/snoopy/dns.c
@@ -488,6 +488,7 @@
memset(rp->srv, 0, sizeof *rp->srv); /* cause trouble */
free(rp->srv);
break;
+ case Tdnskey:
case Tkey:
free(rp->key->data);
memset(rp->key, 0, sizeof *rp->key); /* cause trouble */
@@ -508,9 +509,12 @@
memset(rp->null, 0, sizeof *rp->null); /* cause trouble */
free(rp->null);
break;
+ case Tcaa:
+ free(rp->caa->data);
+ memset(rp->caa, 0, sizeof *rp->caa); /* cause trouble */
+ break;
case Ttxt:
- while(rp->txt != nil){
- t = rp->txt;
+ while(t = rp->txt){
rp->txt = t->next;
free(t->p);
memset(t, 0, sizeof *t); /* cause trouble */