From e5858d5f19c261e4aef6b09b1568296ac0de16e3 Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Thu, 24 May 2018 11:53:19 +0900 Subject: [PATCH] increase code quality(static analysis) Change-Id: If9ba42405574dde1c030d072a7f518c2c4a2e4cd --- server/fido_selection_ui_adaptor.c | 3 +++ server/fido_server.c | 3 --- test/Dummy_ASM_DBUS/dummy_asm_server.c | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/fido_selection_ui_adaptor.c b/server/fido_selection_ui_adaptor.c index 9bb5879..3b5d31b 100755 --- a/server/fido_selection_ui_adaptor.c +++ b/server/fido_selection_ui_adaptor.c @@ -480,6 +480,7 @@ _auth_ui_selector_on_ui_response(Fido *object, GDBusMethodInvocation *invocation if (strcmp(caller, _UI_SVC_BIN_PATH) != 0) { _ERR("[%s] is not allowed", caller); __start_ui_svc_term_timer(); + free(caller); return true; } @@ -517,6 +518,8 @@ CATCH: __start_ui_svc_term_timer(); } + free(caller); + g_main_loop_quit(__mainLoop); return true; } diff --git a/server/fido_server.c b/server/fido_server.c index b7b4bc5..9afed7c 100755 --- a/server/fido_server.c +++ b/server/fido_server.c @@ -686,10 +686,7 @@ __handle_auth(_process_cb_data_t *cb_data, _matched_auth_data_t *matched_auth) if (auth_idx_int == -1) { _ERR("ASM in data missing"); _send_process_response(cb_data, FIDO_ERROR_NO_SUITABLE_AUTHENTICATOR, NULL); - - _free_fido_asm_auth_in(auth_asm_in); SAFE_DELETE(version); - return; } diff --git a/test/Dummy_ASM_DBUS/dummy_asm_server.c b/test/Dummy_ASM_DBUS/dummy_asm_server.c index 0b24aef..97039a6 100755 --- a/test/Dummy_ASM_DBUS/dummy_asm_server.c +++ b/test/Dummy_ASM_DBUS/dummy_asm_server.c @@ -181,12 +181,14 @@ _dbus_on_asm_request(Dummyasm *object, GDBusMethodInvocation *invocation, const if (strcmp(caller_path, _FIDO_SERVICE_PATH) != 0) { _ERR("Only fido-service is allowed to call ASM"); dummyasm_complete_asm_request(object, invocation, -1, NULL); + free(caller_path); return true; } char *req_type = __get_request_type(uaf_request_json); if (req_type == NULL) { - dummyasm_complete_asm_request(object, invocation, -1, NULL); + dummyasm_complete_asm_request(object, invocation, -1, NULL); + free(caller_path); return true; } @@ -204,6 +206,7 @@ _dbus_on_asm_request(Dummyasm *object, GDBusMethodInvocation *invocation, const dummyasm_complete_asm_request(object, invocation, 0, _GET_REGISTRATIONS_RESPONSE); free(req_type); + free(caller_path); return true; } -- 2.7.4