mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	macos: fix leak in proc_self_dirname()
This commit is contained in:
		
							parent
							
								
									081111714e
								
							
						
					
					
						commit
						b516c681fe
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -797,7 +797,9 @@ std::string proc_self_dirname() | ||||||
| 		path = (char *) realloc((void *) path, buflen); | 		path = (char *) realloc((void *) path, buflen); | ||||||
| 	while (buflen > 0 && path[buflen-1] != '/') | 	while (buflen > 0 && path[buflen-1] != '/') | ||||||
| 		buflen--; | 		buflen--; | ||||||
| 	return std::string(path, buflen); | 	std::string str(path, buflen); | ||||||
|  | 	free(path); | ||||||
|  | 	return str; | ||||||
| } | } | ||||||
| #elif defined(_WIN32) | #elif defined(_WIN32) | ||||||
| std::string proc_self_dirname() | std::string proc_self_dirname() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue