ret = snprintf(data_name_lon, MAX_DATA_NAME, "%lf", geocoordinate_info->longitude);
if (ret < 0) {
LOGD_GEOFENCE("ERROR: String will be truncated");
+ sqlite3_finalize(state);
return FENCE_ERR_STRING_TRUNCATED;
}
ret = snprintf(data_name_rad, MAX_DATA_NAME, "%lf", geocoordinate_info->radius);
if (ret < 0) {
LOGD_GEOFENCE("ERROR: String will be truncated");
+ sqlite3_finalize(state);
return FENCE_ERR_STRING_TRUNCATED;
}
}
*geocoordinate_info = (geocoordinate_info_s *)g_malloc0(sizeof(geocoordinate_info_s));
+ if (*geocoordinate_info == NULL) {
+ sqlite3_finalize(state);
+ }
g_return_val_if_fail(*geocoordinate_info, FENCE_ERR_INVALID_PARAMETER);
#ifdef SUPPORT_ENCRYPTION
break;
}
wifi_info = g_slice_new0(wifi_info_s);
+ if (wifi_info == NULL) {
+ sqlite3_finalize(state);
+ }
g_return_val_if_fail(wifi_info, -1);
if (wifi_info) {
bssid = (const char *) sqlite3_column_text(state, 1);
return FENCE_ERR_SQLITE_FAIL;
}
*place_info = (place_info_s *)g_malloc0(sizeof(place_info_s));
+ if (*place_info == NULL) {
+ sqlite3_finalize(state);
+ }
g_return_val_if_fail(*place_info, FENCE_ERR_INTERNAL);
data_name = (char *)sqlite3_column_text(state, ++index);
break;
}
bssid_info_from_db = g_slice_new0(bssid_info_s);
+ if (bssid_info_from_db == NULL) {
+ sqlite3_finalize(state);
+ }
g_return_val_if_fail(bssid_info_from_db, -1);
if (bssid_info_from_db) {
bssid = (const char *)sqlite3_column_text(state, 1);
return FENCE_ERR_SQLITE_FAIL;
}
sqlite3_reset(state);
+ sqlite3_finalize(state);
sqlite3_free(query_two);
char *query_three = sqlite3_mprintf("UPDATE sqlite_sequence SET seq = 0 where name = %Q;", menu_table[FENCE_MAIN_TABLE]);
if (*count <= 0) {
LOGI_GEOFENCE("ERROR: count = %d", *count);
+ sqlite3_finalize(state);
return FENCE_ERR_COUNT;
} else {
LOGI_GEOFENCE("count[%d]", *count);
if (*count < 0) {
LOGI_GEOFENCE("ERROR: count = %d", *count);
+ sqlite3_finalize(state);
return FENCE_ERR_COUNT;
} else {
LOGI_GEOFENCE("count[%d]", *count);
if (*count < 0) {
LOGI_GEOFENCE("ERROR: place count = %d", *count);
+ sqlite3_finalize(state);
return FENCE_ERR_COUNT;
} else {
LOGI_GEOFENCE("place count[%d]", *count);