moira_disconnect might be doing the final edit_groups and in turn call
moira_disconnect again, thus possibly freeing the same memory twice.
"Error contacting Moira server to lookup user %s: %s",
member, error_message(code));
}
- moira_disconnect();
+
+ /* We don't use moira_disconnect()
+ * because we may already be in the routine.
+ */
+ mr_disconnect();
+ mr_connections--;
+
if (!code && ustate!=1 && ustate!=2) return; /* inactive user */
code = PRNOENT;
}