3ccf3c8
diff --git a/server/confpars.c b/server/confpars.c
3ccf3c8
index d79489b..c20d618 100644
3ccf3c8
--- a/server/confpars.c
3ccf3c8
+++ b/server/confpars.c
3ccf3c8
@@ -134,6 +134,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
3ccf3c8
 
3ccf3c8
 	cfile = (struct parse *)0;
3ccf3c8
 #if defined (TRACING)
3ccf3c8
+	// No need to dmalloc huge memory region if we're not going to re-play
3ccf3c8
+	if (!trace_playback()){
3ccf3c8
+		status = new_parse(&cfile, file, NULL, 0, filename, 0);
3ccf3c8
+		goto noreplay;
3ccf3c8
+	};
3ccf3c8
 	flen = lseek (file, (off_t)0, SEEK_END);
3ccf3c8
 	if (flen < 0) {
3ccf3c8
 	      boom:
3ccf3c8
@@ -174,6 +179,7 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
3ccf3c8
 #else
3ccf3c8
 	status = new_parse(&cfile, file, NULL, 0, filename, 0);
3ccf3c8
 #endif
3ccf3c8
+      noreplay:
3ccf3c8
 	if (status != ISC_R_SUCCESS || cfile == NULL)
3ccf3c8
 		return status;
3ccf3c8
 
3ccf3c8
diff --git a/server/confpars.c b/server/confpars.c
3ccf3c8
index 3aecd05..5be4ab1 100644
3ccf3c8
--- a/server/confpars.c
3ccf3c8
+++ b/server/confpars.c
3ccf3c8
@@ -176,6 +176,7 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
3ccf3c8
 	if (trace_record ())
3ccf3c8
 		trace_write_packet (ttype, ulen + tflen + 1, dbuf, MDL);
3ccf3c8
 	status = new_parse(&cfile, -1, fbuf, ulen, filename, 0); /* XXX */
3ccf3c8
+	dfree(dbuf, MDL);
3ccf3c8
 #else
3ccf3c8
 	status = new_parse(&cfile, file, NULL, 0, filename, 0);
3ccf3c8
 #endif
3ccf3c8
@@ -188,9 +189,6 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
3ccf3c8
 	else
3ccf3c8
 		status = conf_file_subparse (cfile, group, group_type);
3ccf3c8
 	end_parse (&cfile);
3ccf3c8
-#if defined (TRACING)
3ccf3c8
-	dfree (dbuf, MDL);
3ccf3c8
-#endif
3ccf3c8
 	return status;
3ccf3c8
 }
3ccf3c8