From a48403700b006daa13109538082f4536a0e6db35 Mon Sep 17 00:00:00 2001 From: Konstantin Baladurin Date: Tue, 7 Jul 2015 13:19:08 +0300 Subject: [PATCH] [FIX] fix prevent --------------------------------------------------------------------------- | CID | Type | File | Function | |-------------------------------------------------------------------------- | 451167 | Resource leak | da_protocol_inst.c | add_preload_probes | |-------------------------------------------------------------------------- | 452808 | Resource leak | da_protocol_inst.c | add_preload_probes | --------------------------------------------------------------------------- Change-Id: Ifd9b743ace327538508bf47ef736defab24d9774 Signed-off-by: Konstantin Baladurin --- daemon/da_protocol_inst.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/da_protocol_inst.c b/daemon/da_protocol_inst.c index 5eff3f3..b6bc360 100644 --- a/daemon/da_protocol_inst.c +++ b/daemon/da_protocol_inst.c @@ -603,7 +603,8 @@ int add_preload_probes(struct lib_list_t **lib_list) /* Add write_msg probe */ ret = create_preload_probe_func(&write_msg_probe, write_msg_addr, 6); if (ret != 0) - return ret; + goto free_write_msg_probe; + probe_list_append(preload_lib, write_msg_probe); preload_lib->func_num = 3; @@ -618,6 +619,8 @@ free_caller_probe: free(get_caller_probe); free_call_type_probe: free(get_call_type_probe); +free_write_msg_probe: + free(write_msg_probe); preload_lib->lib->bin_path = NULL; free_lib(preload_lib); -- 2.7.4