That's the classical realloc() issue: if it returns NULL, the old area
is not freed but we erase the pointer. It was brought by commit
e18d4e828
("BUG/MEDIUM: ssl: backend TLS resumption with sni and TLSv1.3"), and
should be backported where this commit was backported.
ptr = s->ssl_ctx.reused_sess[tid].ptr;
} else {
ptr = realloc(s->ssl_ctx.reused_sess[tid].ptr, len);
+ if (!ptr)
+ free(s->ssl_ctx.reused_sess[tid].ptr);
s->ssl_ctx.reused_sess[tid].ptr = ptr;
s->ssl_ctx.reused_sess[tid].allocated_size = len;
}