From 858a73afbf5018d74920761f7015ac2e7d3987b6 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 4 Jun 2018 00:43:06 +0100 Subject: [PATCH] identify.c: Stash a copy of the caller's description string. If the caller is a one-shot source then the description could well have gone by the time we end up printing a message. --- identify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/identify.c b/identify.c index dd37a6a..e099fb9 100644 --- a/identify.c +++ b/identify.c @@ -82,6 +82,7 @@ static void id_done(id *i) /* --- Dispose of the block --- */ REFFD_DEC(i->q.r); + xfree((/*unconst*/ char *)i->q.desc); xfree(i); } @@ -166,6 +167,7 @@ void identify(const id_req *q) i = xmalloc(sizeof(*i)); i->q = *q; + i->q.desc = xstrdup(q->desc); REFFD_INC(i->q.r); str_sanitize(i->host, inet_ntoa(q->rsin.sin_addr), sizeof(i->host)); -- 2.11.0