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, " ");
__sttd_dbus_service_free();
- if (NULL == engine_appid || NULL == engine_default || 0 == strncmp(engine_appid, engine_default, strlen(engine_appid))) {
+ if (NULL == engine_default || 0 == strncmp(engine_appid, engine_default, strlen(engine_appid))) {
g_server_service_name = (char*)calloc(strlen(STT_SERVER_SERVICE_NAME) + 1, sizeof(char));
if (g_server_service_name)
snprintf(g_server_service_name, strlen(STT_SERVER_SERVICE_NAME) + 1, "%s", STT_SERVER_SERVICE_NAME);