* nntp_mdata_free - Free NntpMboxData, used to destroy hash elements
* @param ptr NNTP data
*/
-void nntp_mdata_free(void *ptr)
+void nntp_mdata_free(void **ptr)
{
- struct NntpMboxData *mdata = ptr;
-
- if (!mdata)
+ if (!ptr || !*ptr)
return;
+
+ struct NntpMboxData *mdata = *ptr;
+
nntp_acache_free(mdata);
mutt_bcache_close(&mdata->bcache);
FREE(&mdata->newsrc_ent);
FREE(&mdata->desc);
- FREE(&ptr);
+ FREE(ptr);
}
/**
time(&adata->check_time);
m->mdata = mdata;
+ m->free_mdata = nntp_mdata_free;
if (!mdata->bcache && (mdata->newsrc_ent || mdata->subscribed || SaveUnsubscribed))
mdata->bcache = mutt_bcache_open(&adata->conn->account, mdata->group);
tmp_mdata = mutt_hash_find(mdata->adata->groups_hash, mdata->group);
if (!tmp_mdata || tmp_mdata != mdata)
- nntp_mdata_free(mdata);
+ nntp_mdata_free((void **) &mdata);
return 0;
}
struct NntpEmailData *nntp_edata_get(struct Email *e);
void nntp_group_unread_stat(struct NntpMboxData *mdata);
void nntp_hash_destructor_t(int type, void *obj, intptr_t data);
-void nntp_mdata_free(void *ptr);
+void nntp_mdata_free(void **ptr);
void nntp_newsrc_gen_entries(struct Context *ctx);
int nntp_open_connection(struct NntpAccountData *adata);