mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-03 21:43:32 +00:00 
			
		
		
		
	nat: Fix some memory leaks in the testcases.
The test cases did not free some of the resources it allocated. Improve the situation a bit. There is still data allocated that is not freed at exit.
This commit is contained in:
		
				
					committed by
					
						
						Holger Hans Peter Freyther
					
				
			
			
				
	
			
			
			
						parent
						
							ddf191eafc
						
					
				
				
					commit
					3615a30d3d
				
			@@ -452,6 +452,8 @@ static void test_paging(void)
 | 
			
		||||
		printf("Should have found it.\n");
 | 
			
		||||
		abort();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	talloc_free(nat);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void test_mgcp_allocations(void)
 | 
			
		||||
@@ -820,6 +822,7 @@ static void test_cr_filter()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	msgb_free(msg);
 | 
			
		||||
	talloc_free(nat);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void test_dt_filter()
 | 
			
		||||
@@ -1040,6 +1043,8 @@ static void test_setup_rewrite()
 | 
			
		||||
	verify_msg(out, cc_setup_national_again,
 | 
			
		||||
			ARRAY_SIZE(cc_setup_national_again));
 | 
			
		||||
	msgb_free(out);
 | 
			
		||||
	bsc_nat_num_rewr_entry_adapt(nat, &nat->num_rewr, NULL);
 | 
			
		||||
	talloc_free(nat);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void test_setup_rewrite_prefix(void)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user