mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Fix a crash on Liquivision import
Without the patch, there is a crash if the dive does not have a location. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									c67812acc3
								
							
						
					
					
						commit
						0ebfcfdf68
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -137,8 +137,12 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int | |||
| 		} else if (place_len) { | ||||
| 			location = strndup(buf + ptr + len + 4, place_len); | ||||
| 		} | ||||
| 
 | ||||
| 		/* Store the location only if we have one */ | ||||
| 		if (len || place_len) { | ||||
| 			dive->dive_site_uuid = create_dive_site(location); | ||||
| 			free(location); | ||||
| 		} | ||||
| 
 | ||||
| 		ptr += len + 4 + place_len; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue