Coverity Issues Fix 71/212771/1 submit/tizen/20190827.044404 submit/tizen/20191001.050214
authorsrinivasa.m <srinivasa.m@samsung.com>
Mon, 26 Aug 2019 14:41:35 +0000 (20:11 +0530)
committersrinivasa.m <srinivasa.m@samsung.com>
Mon, 26 Aug 2019 14:41:35 +0000 (20:11 +0530)
Change-Id: I11052fd2b6cf3bb55c031a7928f07ab307476c52

common/fido_json_handler.c
server/fido_server.c
server/fido_uaf_policy_checker.c

index af212f7..3b8e4b2 100755 (executable)
@@ -1110,6 +1110,9 @@ _uaf_parser_parse_asm_response_discover(GList *asm_response_list, int *error_cod
 
                                        int auth_index = json_object_get_int_member(auth_obj, _JSON_KEY_AUTH_INDEX);
                                        char *auth_idx_str = (char*)calloc(1, 128);
+                                       if(auth_idx_str == NULL) {
+                                               SAFE_DELETE(auth_info);
+                                       }
                                        CATCH_IF_FAIL(auth_idx_str != NULL);
                                        snprintf(auth_idx_str, 127, "%d", auth_index);
 
@@ -3184,6 +3187,9 @@ _uaf_parser_parser_asm_get_reg_response(const char *get_reg_resp)
 
                        if (app_id != NULL || key_id_list != NULL) {
                                _asm_app_reg_t *app_reg = (_asm_app_reg_t*) calloc(1, sizeof(_asm_app_reg_t));
+                               if(app_reg == NULL) {
+                                       g_list_free_full(key_id_list, free);
+                               }
                                CATCH_IF_FAIL(app_reg != NULL);
                                if (app_id != NULL) {
                                        _INFO("app_id = [%s]", app_id);
index 25f5c7d..d872905 100755 (executable)
@@ -1182,6 +1182,9 @@ _discover_response_cb_for_process(int tz_error_code, int error_code, GList *avai
                        if (match_data != NULL) {
 
                                _ui_auth_data_t *ui_data = (_ui_auth_data_t*) calloc(1, sizeof(_ui_auth_data_t));
+                               if(ui_data == NULL) {
+                                       g_list_free_full(ui_data_list, _free_matched_auth_data);
+                               }
                                RET_IF_FAIL_VOID(ui_data != NULL);
                                if (match_data->asm_id != NULL)
                                        ui_data->asm_id = strdup(match_data->asm_id);
index 23fc84f..695f3ec 100755 (executable)
@@ -376,6 +376,9 @@ __copy_png_list(GList *src_list)
                                        fido_rgb_pallette_entry_s *plte_src_data = (fido_rgb_pallette_entry_s*)(p_iter->data);
                                        if (plte_src_data != NULL) {
                                                fido_rgb_pallette_entry_s *plte_dest_data = calloc(1, sizeof(fido_rgb_pallette_entry_s));
+                                               if(plte_dest_data == NULL) {
+                                                       free(dest_data);
+                                               }
                                                RET_IF_FAIL(plte_dest_data != NULL, NULL);
                                                plte_dest_data->r = plte_src_data->r;
                                                plte_dest_data->g = plte_src_data->g;