char smack_label[1024] = {'\0',};
if (!p_cynara) {
- return false;
+ return false;
}
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 (sizeof(smack_label) != fread(smack_label, 1, sizeof(smack_label), fp))
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to fread");
- fclose(fp);
+ fclose(fp);
}
pid_t pid = getpid();
}
if (ret != CYNARA_API_ACCESS_ALLOWED)
- return false;
+ return false;
return true;
}
temp = strdup(language);
}
+ if (NULL == temp) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to allocate memory");
+ return STT_ERROR_OUT_OF_MEMORY;
+ }
+
if (true == client->credential_needed && NULL == client->credential) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Do not have app credential for this engine(%s)", client->current_engine_id);
+ free(temp);
+ temp = NULL;
return STT_ERROR_PERMISSION_DENIED;
}
SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Start is successful but not done");
}
- if (NULL != temp) free(temp);
+ free(temp);
+ temp = NULL;
SLOG(LOG_DEBUG, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");
temp = strdup(language);
}
+ if (NULL == temp) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to allocate memory");
+ return STT_ERROR_OUT_OF_MEMORY;
+ }
+
if (true == client->credential_needed && NULL == client->credential) {
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Do not have app credential for this engine(%s)", client->current_engine_id);
+ free(temp);
+ temp = NULL;
return STT_ERROR_PERMISSION_DENIED;
}
SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Start is successful but not done");
}
- if (NULL != temp) free(temp);
+ free(temp);
+ temp = NULL;
SLOG(LOG_DEBUG, TAG_STTC, "=====");
SLOG(LOG_DEBUG, TAG_STTC, " ");