increase code quality(static analysis) 93/179993/2 accepted/tizen/unified/20180524.050033 submit/tizen/20180524.042524
authorYoungjae Shin <yj99.shin@samsung.com>
Thu, 24 May 2018 02:53:19 +0000 (11:53 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 24 May 2018 04:16:34 +0000 (13:16 +0900)
Change-Id: If9ba42405574dde1c030d072a7f518c2c4a2e4cd

server/fido_selection_ui_adaptor.c
server/fido_server.c
test/Dummy_ASM_DBUS/dummy_asm_server.c

index 9bb5879..3b5d31b 100755 (executable)
@@ -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;
 }
index b7b4bc5..9afed7c 100755 (executable)
@@ -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;
        }
 
index 0b24aef..97039a6 100755 (executable)
@@ -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;
 }