int auth_index = json_object_get_int_member(auth_obj, _JSON_KEY_AUTH_INDEX);
char *auth_idx_str = (char*)calloc(1, 128);
+ CATCH_IF_FAIL(auth_idx_str != NULL);
snprintf(auth_idx_str, 127, "%d", auth_index);
auth_info->auth_index = auth_idx_str;
/* Supported UAF versions is fixed to 1.0*/
fido_version_s *version = calloc(1, sizeof(fido_version_s));
+ CATCH_IF_FAIL(version != NULL);
version->major = _VERSION_MAJOR;
version->minor = _VERSION_MINOR;
JsonObject *auth_obj = json_array_get_object_element(auth_arr, auth_arr_index);
if (auth_obj != NULL) {
fido_authenticator_s *auth_info = (fido_authenticator_s *)calloc(1, sizeof(fido_authenticator_s));
-
+ CATCH_IF_FAIL(auth_info != NULL);
int auth_index = json_object_get_int_member(auth_obj, _JSON_KEY_AUTH_INDEX);
char *auth_idx_str = (char*)calloc(1, 128);
+ CATCH_IF_FAIL(auth_idx_str != NULL);
snprintf(auth_idx_str, 127, "%d", auth_index);
auth_info->auth_index = auth_idx_str;
if (tr_obj != NULL) {
_auth_transaction_t *trans = calloc(1, sizeof(_auth_transaction_t));
-
+ RET_IF_FAIL(trans != NULL, NULL);
trans->content_type = __get_string_from_json_object(tr_obj, _JSON_KEY_CONTENT_TYPE);
trans->content = __get_string_from_json_object(tr_obj, _JSON_KEY_CONTENT);
if (assrt_json_obj != NULL) {
_auth_reg_assertion_t *assrt_data = (_auth_reg_assertion_t*)calloc(1, sizeof(_auth_reg_assertion_t));
+ CATCH_IF_FAIL(assrt_data != NULL);
assrt_data->assertion = __get_string_from_json_object(assrt_json_obj, _JSON_KEY_ASSERTION);
assrt_data->assertion_schm = __get_string_from_json_object(assrt_json_obj, _JSON_KEY_ASSERT_SCHEME);
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));
-
+ CATCH_IF_FAIL(app_reg != NULL);
if (app_id != NULL) {
_INFO("app_id = [%s]", app_id);
app_reg->app_id = strdup(app_id);
_auth_transaction_t *uaf_tr = (_auth_transaction_t*)(uaf_tr_list_iter->data);
_fido_asm_transaction_t *asm_tr = calloc(1, sizeof(_fido_asm_transaction_t));
-
+ RET_IF_FAIL(asm_tr != NULL, NULL);
asm_tr->content = __dup_string(uaf_tr->content);
asm_tr->content_type = __dup_string(uaf_tr->content_type);
if (uaf_tr->display_charac != NULL) {
asm_tr->display_charac = calloc(1, sizeof(_fido_asm_display_png_characteristics_descriptor_t));
-
+ RET_IF_FAIL(asm_tr->display_charac != NULL, NULL);
asm_tr->display_charac->bit_depth = uaf_tr->display_charac->bit_depth;
asm_tr->display_charac->color_type = uaf_tr->display_charac->color_type;
asm_tr->display_charac->compression = uaf_tr->display_charac->compression;
fido_rgb_pallette_entry_s *uaf_plte_entry = (fido_rgb_pallette_entry_s*)(uaf_plte_iter->data);
fido_rgb_pallette_entry_s *asm_plte_entry = calloc(1, sizeof(fido_rgb_pallette_entry_s));
+ RET_IF_FAIL(asm_plte_entry != NULL, NULL);
asm_plte_entry->r = uaf_plte_entry->r;
asm_plte_entry->g = uaf_plte_entry->g;
asm_plte_entry->b = uaf_plte_entry->b;
if (match_data != NULL) {
_ui_auth_data_t *ui_data = (_ui_auth_data_t*) calloc(1, sizeof(_ui_auth_data_t));
+ RET_IF_FAIL_VOID(ui_data != NULL);
if (match_data->asm_id != NULL)
ui_data->asm_id = strdup(match_data->asm_id);
else
if (src_data != NULL) {
fido_display_png_characteristics_descriptor_s *dest_data =
calloc(1, sizeof(fido_display_png_characteristics_descriptor_s));
-
+ RET_IF_FAIL(dest_data != NULL, NULL);
dest_data->bit_depth = src_data->bit_depth;
dest_data->color_type = src_data->color_type;
dest_data->compression = src_data->compression;
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));
+ RET_IF_FAIL(plte_dest_data != NULL, NULL);
plte_dest_data->r = plte_src_data->r;
plte_dest_data->g = plte_src_data->g;
plte_dest_data->b = plte_src_data->b;
for (; allowed_list_iter_next != NULL; allowed_list_iter_next = allowed_list_iter_next->next) {
_matched_auth_data_t *matched_auth_data_nxt = (_matched_auth_data_t*)allowed_list_iter_next->data;
-
+ RET_IF_FAIL(matched_auth_data_nxt != NULL, NULL);
if (strcmp(matched_auth_data_nxt->asm_id, matched_auth_data->asm_id) == 0) {
if (strcmp(matched_auth_data_nxt->auth_index, matched_auth_data->auth_index) == 0) {