+
+
+/* FIXME: We really don't allow much to the callback. For example, it has
+ no chance of reaching the info stack for the item it processes. Should
+ it really be this way? -- Richard Levitte */
+static void cb_leak(MEM *m,
+ void (**cb)(unsigned long, const char *, int, int, void *))
+ {
+ (**cb)(m->order,m->file,m->line,m->num,m->addr);
+ }
+
+void CRYPTO_mem_leaks_cb(void (*cb)(unsigned long, const char *, int, int, void *))
+ {
+ if (mh == NULL) return;
+ CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2);
+ lh_doall_arg(mh,(void (*)())cb_leak,(void *)&cb);
+ CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
+ }