chiark
/
gitweb
/
~mdw
/
fwd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
6f577dd
)
identify.c: Stash a copy of the caller's description string.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 3 Jun 2018 23:43:06 +0000
(
00:43
+0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 4 Jun 2018 03:16:01 +0000
(
04:16
+0100)
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
patch
|
blob
|
blame
|
history
diff --git
a/identify.c
b/identify.c
index dd37a6a131ca42a1ee11ee7fc50430edab7503c7..e099fb93111a9b7f2b4b9d3dcfce13abd01b92db 100644
(file)
--- 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));