mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-03 21:43:32 +00:00 
			
		
		
		
	ipaccess: Fix a resource leak in case the stat is failing
Close the file when the stat is failing. Fixes: Coverity CID 1040711
This commit is contained in:
		@@ -743,6 +743,7 @@ static void analyze_firmware(const char *filename)
 | 
				
			|||||||
	/* verify the file */
 | 
						/* verify the file */
 | 
				
			||||||
	if (fstat(fd, &stat) == -1) {
 | 
						if (fstat(fd, &stat) == -1) {
 | 
				
			||||||
		perror("Can not stat the file");
 | 
							perror("Can not stat the file");
 | 
				
			||||||
 | 
							close(fd);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user