mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Free tag lists propperly
The previous taglist_free didn't free the divetag, it only freed the tag. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									f14ef84c9a
								
							
						
					
					
						commit
						0bdd8f41e0
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		
							
								
								
									
										8
									
								
								dive.c
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								dive.c
									
										
									
									
									
								
							| 
						 | 
					@ -2461,6 +2461,12 @@ static inline void taglist_free_divetag(struct divetag *tag)
 | 
				
			||||||
	free(tag);
 | 
						free(tag);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static inline void tag_entry_free(struct tag_entry *tag_entry)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						taglist_free_divetag(tag_entry->tag);
 | 
				
			||||||
 | 
						free(tag_entry);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Add a tag to the tag_list, keep the list sorted */
 | 
					/* Add a tag to the tag_list, keep the list sorted */
 | 
				
			||||||
static struct divetag *taglist_add_divetag(struct tag_entry **tag_list, struct divetag *tag)
 | 
					static struct divetag *taglist_add_divetag(struct tag_entry **tag_list, struct divetag *tag)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -2529,7 +2535,7 @@ struct divetag *taglist_add_tag(struct tag_entry **tag_list, const char *tag)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void taglist_free(struct tag_entry *entry)
 | 
					void taglist_free(struct tag_entry *entry)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	STRUCTURED_LIST_FREE(struct tag_entry, entry, free)
 | 
						STRUCTURED_LIST_FREE(struct tag_entry, entry, tag_entry_free)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Merge src1 and src2, write to *dst */
 | 
					/* Merge src1 and src2, write to *dst */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue