/* we do not store the message, but we did store the RRs,
* which could be useful for delegation information */
verbose(VERB_ALGO, "TTL 0: dropped msg from cache");
+ if (rep->reason_bogus_str_size) {
+ free(rep->reason_bogus_str);
+ }
free(rep);
/* if the message is SERVFAIL in cache, remove that SERVFAIL,
* so that the TTL 0 response can be returned for future
if(!msg->rep)
return NULL;
msg->rep->reason_bogus = LDNS_EDE_NONE;
+ msg->rep->reason_bogus_str_size = 0;
+ msg->rep->reason_bogus_str = NULL;
if(num > RR_COUNT_MAX)
return NULL; /* integer overflow protection */
msg->rep->rrsets = (struct ub_packed_rrset_key**)
msg->rep->rrset_count = r->rrset_count;
msg->rep->authoritative = r->authoritative;
msg->rep->reason_bogus = r->reason_bogus;
+ if (r->reason_bogus_str_size > 0) {
+ msg->rep->reason_bogus_str = strdup(r->reason_bogus_str);
+ msg->rep->reason_bogus_str_size = r->reason_bogus_str_size;
+ }
+
if(!rrset_array_lock(r->ref, r->rrset_count, now_control)) {
return NULL;
}
((ntohs(ref.key->rk.type)==LDNS_RR_TYPE_NS
&& !pside) ? qstarttime:*env->now + leeway));
}
+ if (rep->reason_bogus_str_size) {
+ free(rep->reason_bogus_str);
+ }
free(rep);
return 1;
} else {