The calling smtpsink recycles the structures, and can recycle private
data along with it.
static int
ssm_nmsg_connect(struct conn *c)
{
- struct ssm_nmsg_state *nms = malloc(sizeof(struct ssm_nmsg_state));
+ struct ssm_nmsg_state *nms = ssm_getpriv(&ss_module, c);
char ip[80];
const uint8_t *addr = (const uint8_t *)ip;
+ if (!nms) nms = malloc(sizeof(struct ssm_nmsg_state));
+
if (nms) {
nms->msg = nmsg_message_init(nmsg_emailmod);
nms->nurl = 0;