mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Cleanup: avoid memory leak
Coverity CID 45121 Coverity CID 45163 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									d3118bedd4
								
							
						
					
					
						commit
						ecd8580de9
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -204,6 +204,7 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive) | |||
| 	if (dt_dive->dive_site_uuid == 0) | ||||
| 		dt_dive->dive_site_uuid = create_dive_site(buffer, dt_dive->when); | ||||
| 	free(locality); | ||||
| 	locality = NULL; | ||||
| 	free(dive_point); | ||||
| 
 | ||||
| 	/*
 | ||||
|  | @ -471,9 +472,9 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive) | |||
| 		dt_dive->notes = calloc((len +1), 1); | ||||
| 		dt_dive->notes = memcpy(dt_dive->notes, buffer, len); | ||||
| 		free(tmp_string1); | ||||
| 		if (tmp_notes_str != NULL) | ||||
| 			free(tmp_notes_str); | ||||
| 	} | ||||
| 	if (tmp_notes_str != NULL) | ||||
| 		free(tmp_notes_str); | ||||
| 
 | ||||
| 	/*
 | ||||
| 	 * Alarms 1 and Alarms2 - Bit tables - Not in Subsurface, we use the profile | ||||
|  | @ -565,6 +566,7 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive) | |||
| 	free(devdata); | ||||
| 	return membuf; | ||||
| bail: | ||||
| 	free(locality); | ||||
| 	free(devdata); | ||||
| 	return NULL; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue