From 7e1e8f67a8081e058954e2927ef342fb01176d97 Mon Sep 17 00:00:00 2001 From: jkjo92 Date: Mon, 23 Oct 2017 16:08:33 +0900 Subject: [PATCH] fix fido-service crash Change-Id: I10d81a78338c447022b837745430a97a041bae66 Signed-off-by: jkjo92 --- server/fido_app_id_handler.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/fido_app_id_handler.c b/server/fido_app_id_handler.c index 23b01fa..36d144b 100755 --- a/server/fido_app_id_handler.c +++ b/server/fido_app_id_handler.c @@ -402,7 +402,7 @@ __get_pub_key_from_cert(const char *cert_b64) int ret = __b64_decode(cert_b64, strlen(cert_b64), &cert_raw, &cert_raw_len); if (ret != 0) { _ERR("__b64_decode failed"); - free(cert_raw); + SAFE_DELETE(cert_raw); return NULL; } @@ -436,7 +436,7 @@ __get_pub_key_from_cert(const char *cert_b64) if (ret != 1) { _ERR("EVP_Digest failed"); OPENSSL_free(der_pubkey); - free(cert_raw); + SAFE_DELETE(cert_raw); return NULL; } @@ -444,7 +444,6 @@ __get_pub_key_from_cert(const char *cert_b64) char *pub_key = __b64_encode(pubkey_der_digest, (int)hashed_len); OPENSSL_free(der_pubkey); - free(cert_raw); if (pub_key != NULL) _INFO("%s", pub_key); -- 2.7.4