mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Exit add_plan_to_notes() in plannernotes.c always via label finished
Replace an early "return" in add_plan_to_notes() with a "goto finished;" This was the initial idea of doing it plus it fixes a potential memory leak (missing free for icdbuffer). Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
		
							parent
							
								
									4b2f289e4f
								
							
						
					
					
						commit
						f08e24d65b
					
				
					 1 changed files with 1 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -134,9 +134,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
 | 
			
		|||
			subsurface_canonical_version(),
 | 
			
		||||
			translate("gettextFromC", "dive plan</b> (overlapping dives detected)"));
 | 
			
		||||
		dive->notes = strdup(buffer);
 | 
			
		||||
		free((void *)buffer);
 | 
			
		||||
		free((void *)temp);
 | 
			
		||||
		return;
 | 
			
		||||
		goto finished;
 | 
			
		||||
	} else if (diveplan->surface_interval >= 48 * 60 *60) {
 | 
			
		||||
		const char *current_date = get_current_date();
 | 
			
		||||
		len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %s</b><br>",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue