mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	Fix leak of file descriptors in odd networking situations
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		
							
								
								
									
										2
									
								
								acl.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								acl.c
									
									
									
									
									
								
							@@ -259,11 +259,13 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
 | 
			
		||||
	sin.sin_addr = *them;
 | 
			
		||||
	if (connect(s, (struct sockaddr *)&sin, sizeof(sin))) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Cannot connect\n");
 | 
			
		||||
		close(s);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
	slen = sizeof(sin);
 | 
			
		||||
	if (getsockname(s, (struct sockaddr *)&sin, &slen)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Cannot get socket name\n");
 | 
			
		||||
		close(s);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
	close(s);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user