From: chris mikkelson Date: Wed, 25 Mar 2009 03:11:38 +0000 (-0500) Subject: listener spec will typically be a literal string or argv, which X-Git-Url: https://git.mikk.net/?a=commitdiff_plain;h=6682fe6295a7bb9fc8c48855efb28383d87f0ca6;p=smtpsink listener spec will typically be a literal string or argv, which we cannot modify in place. strdup() it. --- diff --git a/conn_pool.c b/conn_pool.c index daf10e4..9a4392a 100644 --- a/conn_pool.c +++ b/conn_pool.c @@ -133,11 +133,13 @@ new_listener(char *spec) { int *sock; int one = 1, port = 25; - char *host = spec; - char *t = strchr(spec, ':'); + char *host, *t; struct sockaddr_in l_addr; pthread_t thread; + host = strdup(spec); + t = strchr(host, ':'); + if (t) { *t++ = 0; port = atoi(t);