struct element *e = (struct element *)data;
const char *f;
char buf[AIL_SQL_QUERY_MAX_LEN];
+ int t;
f = sql_get_filter(e->prop);
- int t;
+ if (f == NULL)
+ return;
+
ELEMENT_TYPE(e, t);
switch (t) {
c = NULL;
GSList *l;
-
+
snprintf(w, AIL_SQL_QUERY_MAX_LEN, " WHERE ");
for (l = filter->list; l; l = g_slist_next(l)) {
return AIL_ERROR_DB_FAILED;
}
ai = appinfo_create();
+ if (ai == NULL) {
+ _E("out of memory");
+ db_finalize(stmt);
+ return AIL_ERROR_FAIL;
+ }
appinfo_set_stmt(ai, stmt);
while (db_step(stmt) == AIL_ERROR_OK) {
_E("db_prepare fail for query = %s",q);
return AIL_ERROR_DB_FAILED;
}
+
ai = appinfo_create();
+ if (ai == NULL) {
+ _E("Failed to create appinfo");
+ db_finalize(stmt);
+ return AIL_ERROR_OUT_OF_MEMORY;
+ }
appinfo_set_stmt(ai, stmt);
while (db_step(stmt) == AIL_ERROR_OK) {
return AIL_ERROR_DB_FAILED;
}*/
ai = appinfo_create();
+ if (ai == NULL) {
+ _E("out of memory");
+ db_finalize(stmt);
+ return AIL_ERROR_FAIL;
+ }
appinfo_set_stmt(ai, stmt);
uint i = 0;
_E("db_prepare fail for query = %s",q);
return AIL_ERROR_DB_FAILED;
}
+
ai = appinfo_create();
+ if (ai == NULL) {
+ _E("Failed to create appinfo");
+ db_finalize(stmt);
+ return AIL_ERROR_DB_FAILED;
+ }
+
appinfo_set_stmt(ai, stmt);
uint i = 0;
while (i = db_step(stmt) == AIL_ERROR_OK) {
if (AIL_CB_RET_CANCEL == r)
break;
}
- appinfo_destroy(ai);
+ appinfo_destroy(ai);
db_finalize(stmt);
+
return AIL_ERROR_OK;
}