From 74c9e7fb4393f160b45166b1c414a1e9996ca11b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Feb 2014 18:31:07 +0100 Subject: fix a segfault when otr-coloring /me messages --- otr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/otr.c b/otr.c index a002f1a4..c0a890fa 100644 --- a/otr.c +++ b/otr.c @@ -725,6 +725,7 @@ void op_convert_msg(void *opdata, ConnContext *ctx, OtrlConvertType typ, if(typ == OTRL_CONVERT_RECEIVING) { char *msg = g_strdup(src); + char *buf = msg; /* HTML decoding */ if(set_getbool(&ic->bee->set, "otr_does_html") && @@ -760,7 +761,7 @@ void op_convert_msg(void *opdata, ConnContext *ctx, OtrlConvertType typ, *dst = g_strdup_printf("%s\x03%.2d%s%s\x0F", pre, color, sep, msg); - g_free(msg); + g_free(buf); } } else { /* HTML encoding */ -- cgit v1.2.3