diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-18 14:01:19 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-18 14:01:19 +0100 |
commit | 103392620e2efc098bedeaac5438506a3036d9cf (patch) | |
tree | a08300f5e1e3d8be655f1a782181089fb40ccb33 /src | |
parent | 24bc7297b74b1f70554188e25d3c6a8037016e58 (diff) | |
download | rspamd-103392620e2efc098bedeaac5438506a3036d9cf.tar.gz rspamd-103392620e2efc098bedeaac5438506a3036d9cf.zip |
[Minor] Remove missing dependencies from runtime checks
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/symbols_cache.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index eac6c8d0c..abed26fc3 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -415,7 +415,7 @@ rspamd_symbols_cache_post_init (struct symbols_cache *cache) 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); @@ -506,6 +506,16 @@ rspamd_symbols_cache_post_init (struct symbols_cache *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); |