l = services;
}
service = l->data;
+ retv_if(NULL == service, UAM_ERROR_NOT_FOUND);
monitor = __uam_find_monitor(monitors, sender, svc_name, detection_type);
if (!monitor) {
int ret;
char *sql;
int count;
- bool result;
+ bool result = false;
sql = sqlite3_mprintf(
"SELECT count(*) FROM sqlite_master WHERE type='table' AND name ='%s';", table);
ret = sqlite3_prepare_v2(database, sql, strlen(sql), &stmt, NULL);
if (SQLITE_OK != ret) {
UAM_ERR("sqlite3_prepare_v2 failed, [%d:%s]", ret, sqlite3_errmsg(database));
- return false;
+ result = false;
+ goto is_table_existing_done;
}
ret = sqlite3_step(stmt);
if (SQLITE_ROW != ret) {
UAM_ERR("sqlite3_step failed, [%d:%s]", ret, sqlite3_errmsg(database));
- return false;
+ result = false;
+ goto is_table_existing_done;
}
count = sqlite3_column_int(stmt, 0);
else
result = false;
+is_table_existing_done:
sqlite3_finalize(stmt);
sqlite3_free(sql);