From 27cd8b3a63485df4994b311281669c94e0f43a37 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Mon, 27 Jul 2015 00:08:28 +0200
Subject: degesch: fix memory leak
---
degesch.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/degesch.c b/degesch.c
index b24f502..c840245 100644
--- a/degesch.c
+++ b/degesch.c
@@ -5486,7 +5486,7 @@ irc_handle_privmsg_text (struct server *s,
}
char *nickname = irc_cut_nickname (msg->prefix);
- const char *prefixes = irc_get_privmsg_prefix
+ char *prefixes = irc_get_privmsg_prefix
(s, str_map_find (&s->irc_users, nickname), target);
// IRCv3.2 echo-message could otherwise cause us to highlight ourselves
@@ -5505,6 +5505,7 @@ irc_handle_privmsg_text (struct server *s,
"#a<#S#S>#r #m", ATTR_HIGHLIGHT, prefixes, nickname, text->str);
free (nickname);
+ free (prefixes);
}
static void
@@ -6516,12 +6517,13 @@ static void
log_autosplit_privmsg (struct server *s,
struct send_autosplit_args *a, struct buffer *buffer, const char *line)
{
- const char *prefixes = irc_get_privmsg_prefix (s, s->irc_user, a->target);
+ char *prefixes = irc_get_privmsg_prefix (s, s->irc_user, a->target);
if (buffer && soft_assert (s->irc_user))
log_outcoming_privmsg (s, buffer,
prefixes, s->irc_user->nickname, line);
else
log_outcoming_orphan_privmsg (s, a->target, line);
+ free (prefixes);
}
#define SEND_AUTOSPLIT_PRIVMSG(s, target, message) \
--
cgit v1.2.3-70-g09d2