SLOG(LOG_WARN, vc_db_tag(), "[WARNING] There is no table (%s) (%d). Make a table", VC_INFO_TABLE, ret);
if (VC_DB_ERROR_NONE != __vc_db_create_table(db_handle, VC_INFO_TABLE)) {
SLOG(LOG_ERROR, vc_db_tag(), "[ERROR] Fail to create table(%s), %d", VC_INFO_TABLE, ret);
+ free(sql);
+ sql = NULL;
return VC_DB_ERROR_OPERATION_FAILED;
}
} else {
SLOG(LOG_WARN, vc_db_tag(), "[WARNING] There is no table (%s) (%d). Make a table", VC_INFO_TABLE, ret);
if (VC_DB_ERROR_NONE != __vc_db_create_table(db_handle, VC_INFO_TABLE)) {
SLOG(LOG_ERROR, vc_db_tag(), "[ERROR] Fail to create table(%s), %d", VC_INFO_TABLE, ret);
+ free(sql);
+ sql = NULL;
return VC_DB_ERROR_OPERATION_FAILED;
}
} else {
SLOG(LOG_WARN, vc_db_tag(), "[WARNING] There is no table (%s) (%d). Make a table", VC_RESULT_TABLE, ret);
if (VC_DB_ERROR_NONE != __vc_db_create_table(db_handle, VC_RESULT_TABLE)) {
SLOG(LOG_ERROR, vc_db_tag(), "[ERROR] Fail to create table(%s), %d", VC_RESULT_TABLE, ret);
+ free(sql);
+ sql = NULL;
return VC_DB_ERROR_OPERATION_FAILED;
}
} else {
}
SLOG(LOG_WARN, vc_db_tag(), "[SQL] %s", sql);
+ free(sql);
+ sql = NULL;
return VC_DB_ERROR_NONE;
}
}
/* Check engine id is valid */
- if (0 != strcmp(engine, engine_info->uuid)) {
+ if (NULL == engine_info->uuid || 0 != strcmp(engine, engine_info->uuid)) {
iter = g_slist_next(iter);
continue;
}
free(g_config_info->engine_id);
g_config_info->engine_id = NULL;
}
- if (engine_info->uuid)
- g_config_info->engine_id = strdup(engine_info->uuid);
+
+ g_config_info->engine_id = strdup(engine_info->uuid);
/* Engine is valid*/