55f1ad6
diff -Naur dns64/dns64.c dns64/dns64.c
55f1ad6
--- dns64/dns64.c	2018-12-11 04:46:02.000000000 -0500
55f1ad6
+++ dns64/dns64.c	2018-12-12 12:39:30.589057421 -0500
55f1ad6
@@ -628,6 +628,7 @@
55f1ad6
 
55f1ad6
 	/* Store the response in cache. */
55f1ad6
 	if ( (!iq || !iq->started_no_cache_store) &&
55f1ad6
+		qstate->return_msg && qstate->return_msg->rep &&
55f1ad6
 		!dns_cache_store(qstate->env, &qstate->qinfo, qstate->return_msg->rep,
55f1ad6
 		0, 0, 0, NULL, qstate->query_flags))
55f1ad6
 		log_err("out of memory");