From: Manasij Sur Roy Date: Thu, 20 Apr 2017 09:57:59 +0000 (+0530) Subject: Fixed SVACE issues X-Git-Tag: accepted/tizen/unified/20170421.115625^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d21793ba19ed74a8c7bc1649ee88f1135da64ef5;p=platform%2Fcore%2Faccount%2Ffido-client.git Fixed SVACE issues Change-Id: I34ae398c9c8e98e29b5ae7be791168ffc9a100de Signed-off-by: Manasij Sur Roy --- diff --git a/common/fido_b64_util.c b/common/fido_b64_util.c index 32f8100..cbb4141 100644 --- a/common/fido_b64_util.c +++ b/common/fido_b64_util.c @@ -128,6 +128,8 @@ _fido_b64url_decode(const unsigned char *in, int inlen, unsigned char *out, int if (bmem) BIO_free_all(bmem); + SAFE_DELETE(base64); + _INFO("_fido_b64url_decode end"); return 0; diff --git a/common/fido_json_handler.c b/common/fido_json_handler.c index bb2a680..f52e695 100644 --- a/common/fido_json_handler.c +++ b/common/fido_json_handler.c @@ -2487,6 +2487,7 @@ _uaf_composer_compose_dereg_request(_response_t *uaf_res) json_builder_add_string_value(obj, (char *)key_id_enc); _INFO("keyid=[%s]", key_id_enc); } + SAFE_DELETE(key_id_enc); } diff --git a/common/fido_tlv_util.c b/common/fido_tlv_util.c index 6b39c4d..5b2c28d 100644 --- a/common/fido_tlv_util.c +++ b/common/fido_tlv_util.c @@ -87,7 +87,10 @@ _tlv_util_decode_reg_assertion(char *tlv_enc) unsigned char *tlv_dec = calloc(1, tlv_dec_len); int r = _fido_b64url_decode((unsigned char *)tlv_enc, in_len, tlv_dec, &tlv_dec_len); - RET_IF_FAIL(r == 0, NULL); + if (r != 0) { + SAFE_DELETE(tlv_dec); + return NULL; + } _INFO("in len = [%d], decoded len = [%d]", in_len, tlv_dec_len); diff --git a/fido_svc_ui/fido_ui_server.c b/fido_svc_ui/fido_ui_server.c index 083080d..64b6fac 100644 --- a/fido_svc_ui/fido_ui_server.c +++ b/fido_svc_ui/fido_ui_server.c @@ -343,6 +343,7 @@ void genlist_select_cb(void *data, Evas_Object *obj, void *event_info) SAFE_DELETE(response); } } + SAFE_DELETE(selected_auth); } static char* diff --git a/server/fido_selection_ui_adaptor.c b/server/fido_selection_ui_adaptor.c index a7fc435..9bb5879 100755 --- a/server/fido_selection_ui_adaptor.c +++ b/server/fido_selection_ui_adaptor.c @@ -306,6 +306,8 @@ __launch_svc_ui(bundle *ui_req) break; } + bundle_free(ui_req); + if (ui_pid < 0) return FIDO_ERROR_UNKNOWN; diff --git a/server/fido_server.c b/server/fido_server.c index 65b2a2b..89897a2 100755 --- a/server/fido_server.c +++ b/server/fido_server.c @@ -648,7 +648,7 @@ _ui_response_callback(int error_code, _ui_auth_data_t *selected_auth_data, void if (cb_data->type == _PROCESS_TYPE_REG) __handle_reg(cb_data, match_data); - if (cb_data->type == _PROCESS_TYPE_AUTH) + else if (cb_data->type == _PROCESS_TYPE_AUTH) __handle_auth(cb_data, match_data); _free_matched_auth_data(match_data);