init_paths: fix minor memory leak
Fields "name" (created with strdup in new_entry) and "pathname" (created with g_strdup_printf in new_entry) of pathelem struct should be freed before the whole struct is. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
		
							parent
							
								
									b0f9300ca3
								
							
						
					
					
						commit
						00a9cacaea
					
				| @ -160,7 +160,9 @@ void init_paths(const char *prefix) | ||||
|     base = new_entry("", NULL, pref_buf); | ||||
|     base = add_dir_maybe(base); | ||||
|     if (base->num_entries == 0) { | ||||
|         free (base); | ||||
|         g_free(base->pathname); | ||||
|         free(base->name); | ||||
|         free(base); | ||||
|         base = NULL; | ||||
|     } else { | ||||
|         set_parents(base, base); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Kirill Batuzov
						Kirill Batuzov