From 8222776ff9212f0f1bdb559fd277d0e13d68afd4 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 8 Dec 2022 07:08:53 +0100 Subject: Little tweak to previous change to avoid a memleak. --- html.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'html.c') diff --git a/html.c b/html.c index de054cb..45bea06 100644 --- a/html.c +++ b/html.c @@ -367,7 +367,13 @@ d_char *build_mentions(snac *snac, char *msg) if (type && strcmp(type, "Mention") == 0 && href && strcmp(href, snac->actor) != 0 && name) { - if (name[0] != '@') name = xs_str_cat(xs_str_new("@"), name); + xs *s1 = NULL; + + if (name[0] != '@') { + s1 = xs_fmt("@%s", name); + name = s1; + } + xs *l = xs_split(name, "@"); /* is it a name without a host? */ -- cgit v1.2.3