Hi Daniel,

presence seems to share the db connection on the clean functions.
this leads to messages like

[dbt_base.c:150]: dbt_free_result(): unable to free internal structure

here is mod_init of in presence.c
if(clean_period>0)
{
register_timer(msg_presentity_clean, 0, clean_period);
register_timer(msg_watchers_clean, 0, clean_period);
}


i included a updated patch tested against master.
please consider including it.

Best