struct delayed_cache_dependency *ddep;
struct delayed_cache_condition *dcond;
GList *cur;
- guint i, j;
+ gint i, j;
gint id;
rspamd_symbols_cache_resort (cache);
msg_err_cache ("cannot find dependency on symbol %s", dep->sym);
}
}
+
+ /* Reversed loop to make removal safe */
+ for (j = it->deps->len - 1; j >= 0; j --) {
+ dep = g_ptr_array_index (it->deps, j);
+
+ if (dep->item == NULL) {
+ /* Remove useless dep */
+ g_ptr_array_remove_index (it->deps, j);
+ }
+ }
}
g_ptr_array_sort_with_data (cache->prefilters, prefilters_cmp, cache);