if (fake_rep) {
/* Append reply to the existing list */
fake_rep->rcode = rcode;
- DL_APPEND (fake_rep->result, reply);
+
+ if (reply) {
+ DL_APPEND (fake_rep->result, reply);
+ }
}
else {
fake_rep = calloc (1, sizeof (*fake_rep) + len);
}
memcpy (&fake_rep->key, srch, sizeof (*srch) + len);
- DL_APPEND (fake_rep->result, reply);
+
+ if (reply) {
+ DL_APPEND (fake_rep->result, reply);
+ }
+
HASH_ADD (hh, resolver->fake_elts, key, sizeof (*srch) + len, fake_rep);
}
}
\ No newline at end of file