Skip to contentSkip to conversation

objtool: Fix a memory leak bug

PATCH In review Jiapeng Chong 2 participants 2 messages Mar 9, 2021 objtool

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 objtool: Fix a memory leak bug

Fix the following cppcheck warnings:

tools/objtool/check.c(1102): error: Memory leak: orig_alt_group.

---
 tools/objtool/check.c | 1 +
 1 file changed, 1 insertion(+)
tools/objtool/check.c +1 -0
index 068cdb4..bfa7c31 100644
@@ -1099,6 +1099,7 @@ static int handle_group_alt(struct objtool_file *file,
 				     sizeof(struct cfi_state *));
 	if (!orig_alt_group->cfi) {
 		WARN("calloc failed");
+		free(orig_alt_group);
 		return -1;
 	}
 
Signature · 1 line
1.8.3.1