philipp / rpms / dhcp

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