perf header: Fix memory leak for the "Not caching a kptr_restrict'ed /proc/kallsyms" case
cppcheck reported: [util/header.c:316]: (error) Memory leak: filename [util/header.c:316]: (error) Memory leak: linkname Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Link: http://lkml.kernel.org/r/9377388.0eFDp53iW6@storm Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
		
					parent
					
						
							
								0b9e01a4f0
							
						
					
				
			
			
				commit
				
					
						fdae637391
					
				
			
		
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -313,7 +313,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
 | 
				
			||||||
	if (is_kallsyms) {
 | 
						if (is_kallsyms) {
 | 
				
			||||||
		if (symbol_conf.kptr_restrict) {
 | 
							if (symbol_conf.kptr_restrict) {
 | 
				
			||||||
			pr_debug("Not caching a kptr_restrict'ed /proc/kallsyms\n");
 | 
								pr_debug("Not caching a kptr_restrict'ed /proc/kallsyms\n");
 | 
				
			||||||
			return 0;
 | 
								err = 0;
 | 
				
			||||||
 | 
								goto out_free;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		realname = (char *) name;
 | 
							realname = (char *) name;
 | 
				
			||||||
	} else
 | 
						} else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue