From 68ceda8a5efe903f447dd801c230cade96499c81 Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Mon, 28 Dec 2015 13:37:15 +0900 Subject: [PATCH] [WGID-29067, 29068] Fix the Svace issues Change-Id: I8feae7fbb49e787898f9f8ad853c2e21760f5be0 Signed-off-by: Seonah Moon --- packaging/capi-network-tethering.spec | 2 +- src/tethering.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packaging/capi-network-tethering.spec b/packaging/capi-network-tethering.spec index fa18a49..e860353 100644 --- a/packaging/capi-network-tethering.spec +++ b/packaging/capi-network-tethering.spec @@ -1,6 +1,6 @@ Name: capi-network-tethering Summary: Tethering Framework -Version: 1.0.27 +Version: 1.0.28 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/tethering.c b/src/tethering.c index 87d3d9f..3b028a9 100755 --- a/src/tethering.c +++ b/src/tethering.c @@ -272,12 +272,20 @@ static tethering_error_e __set_passphrase(const char *passphrase, const unsigned ret = ckmc_remove_data(alias); if (ret != CKMC_ERROR_NONE) { ERR("Fail to remove old data : %d", ret); + + if (alias) + free(alias); + return TETHERING_ERROR_OPERATION_FAILED; } ret = ckmc_save_data(alias, ckmc_buf, ckmc_policy); if (ret != CKMC_ERROR_NONE) { ERR("Fail to save the passphrase : %d", ret); + + if (alias) + free(alias); + return TETHERING_ERROR_OPERATION_FAILED; } @@ -326,6 +334,10 @@ static tethering_error_e __get_passphrase(char *passphrase, if (ret == 0) { ERR("generate_initial_passphrase failed : %d\n", *passphrase_len); + + if (alias) + free(alias); + return TETHERING_ERROR_OPERATION_FAILED; } else { *passphrase_len = ret; @@ -333,6 +345,10 @@ static tethering_error_e __get_passphrase(char *passphrase, if (__set_passphrase(passphrase, *passphrase_len) != TETHERING_ERROR_NONE) { DBG("set_passphrase is failed : %s, %d", passphrase, *passphrase_len); + + if (alias) + free(alias); + return TETHERING_ERROR_OPERATION_FAILED; } } -- 2.7.4