diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 18e9b80e4..a8b15b21a 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -589,6 +589,12 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen) err = ERR_NONE; + if (!msg) { + if (errlen) + snprintf(errmsg, errlen, "out of memory"); + return ERR_ALERT | ERR_FATAL; + } + /* ensure we never return garbage */ if (errlen) *errmsg = 0;