From 03b54ce0e84d4d48f8cabed82127c07f5baa58de Mon Sep 17 00:00:00 2001
From: Lubos Slovak <lubos.slovak@nic.cz>
Date: Thu, 5 May 2011 11:21:52 +0200
Subject: [PATCH] Temporary fix for wireformat deallocation.

refs #816
---
 src/dnslib/packet.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dnslib/packet.c b/src/dnslib/packet.c
index 20d4e2208f..7cbe31a905 100644
--- a/src/dnslib/packet.c
+++ b/src/dnslib/packet.c
@@ -637,6 +637,7 @@ static void dnslib_packet_free_tmp_rrsets(dnslib_packet_t *pkt)
  */
 static void dnslib_packet_free_allocated_space(dnslib_packet_t *pkt)
 {
+	/*! @todo These checks are no longer OK. */
 	if (pkt->max_an_rrsets > DEFAULT_ANCOUNT) {
 		free(pkt->answer);
 	}
@@ -917,9 +918,10 @@ void dnslib_packet_free(dnslib_packet_t **packet)
 	debug_dnslib_packet("Freeing additional allocated space...\n");
 	dnslib_packet_free_allocated_space(*packet);
 
+	// do not free wireformat for now - TODO: change
 	// free the space for wireformat
-	assert((*packet)->wireformat != NULL);
-	free((*packet)->wireformat);
+//	assert((*packet)->wireformat != NULL);
+//	free((*packet)->wireformat);
 
 	debug_dnslib_packet("Freeing packet structure\n");
 	free(*packet);
-- 
GitLab