static int __check_privilege(const char* uid, const char * privilege)
{
FILE *fp = NULL;
- char smack_label[1024] = "/proc/self/attr/current";
+ char label_path[1024] = "/proc/self/attr/current";
+ char smack_label[1024] = {'\0',};
if (!p_cynara) {
return false;
}
- fp = fopen(smack_label, "r");
+ fp = fopen(label_path, "r");
if (fp != NULL) {
if (fread(smack_label, 1, sizeof(smack_label), fp) <= 0)
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to fread");
if (NULL != client->current_engine_id) {
free(client->current_engine_id);
+ client->current_engine_id = NULL;
}
SLOG(LOG_DEBUG, TAG_STTC, "===== engined_id(%s)", engine_id);
SLOG(LOG_DEBUG, TAG_STTC, "Supported options : silence(%s), credential(%s)", silence_supported ? "support" : "no support", credential_needed ? "need" : "no need");
}
+#ifdef __UNUSED_CODES__
if (NULL != client->current_engine_id) {
ret = -1;
int count = 0;
}
}
}
-
+#endif
SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] uid(%d)", client->uid);
client->before_state = client->current_state;
if (NULL != current_engine_id) {
free(current_engine_id);
+ current_engine_id = NULL;
}
client->supported_lang_cb = NULL;