philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/dhcp-4.2.5-omapi-leak.patch

c8bb8f
diff -up dhcp-4.2.5/common/comapi.c.leak dhcp-4.2.5/common/comapi.c
c8bb8f
diff -up dhcp-4.2.5/server/db.c.leak dhcp-4.2.5/server/db.c
c8bb8f
--- dhcp-4.2.5/server/db.c.leak	2013-07-02 13:34:56.000000000 +0200
c8bb8f
+++ dhcp-4.2.5/server/db.c	2013-07-02 13:37:06.335729135 +0200
c8bb8f
@@ -414,6 +414,7 @@ int write_host (host)
c8bb8f
 			fputc (';', db_file);
c8bb8f
 			if (errno)
c8bb8f
 				++errors;
c8bb8f
+			data_string_forget (&ip_addrs, MDL);
c8bb8f
 		}
c8bb8f
 
c8bb8f
 		if (host -> named_group) {
c8bb8f
diff -up dhcp-4.2.5/server/omapi.c.leak dhcp-4.2.5/server/omapi.c
c8bb8f
--- dhcp-4.2.5/server/omapi.c.leak	2013-01-03 01:02:25.000000000 +0100
c8bb8f
+++ dhcp-4.2.5/server/omapi.c	2013-07-02 13:41:05.701429114 +0200
c8bb8f
@@ -1179,8 +1179,6 @@ isc_result_t dhcp_host_destroy (omapi_ob
c8bb8f
 	if (h -> type != dhcp_type_host)
c8bb8f
 		return DHCP_R_INVALIDARG;
c8bb8f
 
c8bb8f
-#if defined (DEBUG_MEMORY_LEAKAGE) || \
c8bb8f
-		defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
c8bb8f
 	struct host_decl *host = (struct host_decl *)h;
c8bb8f
 	if (host -> n_ipaddr)
c8bb8f
 		host_dereference (&host -> n_ipaddr, file, line);
c8bb8f
@@ -1199,7 +1197,6 @@ isc_result_t dhcp_host_destroy (omapi_ob
c8bb8f
 		omapi_object_dereference ((omapi_object_t **)
c8bb8f
 					  &host -> named_group, file, line);
c8bb8f
 	data_string_forget (&host -> auth_key_id, file, line);
c8bb8f
-#endif
c8bb8f
 
c8bb8f
 	return ISC_R_SUCCESS;
c8bb8f
 }
c8bb8f
@@ -1285,6 +1282,7 @@ isc_result_t dhcp_host_stuff_values (oma
c8bb8f
 						  ip_addrs.data, ip_addrs.len);
c8bb8f
 		if (status != ISC_R_SUCCESS)
c8bb8f
 			return status;
c8bb8f
+		data_string_forget (&ip_addrs, MDL);
c8bb8f
 	}
c8bb8f
 
c8bb8f
 	if (host -> client_identifier.len) {