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;
}
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;
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;
}
}