summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Ceolin <flavio.ceolin@gmail.com>2015-08-07 15:55:19 -0300
committerFlavio Ceolin <flavio.ceolin@gmail.com>2015-08-16 20:26:52 -0300
commita20843059359359164bcfe419854ff7157f96a87 (patch)
treee65de9b69cfb27630a81755e9090888c1039c5bc
parent9074791d45ac2b472271d1f79746a4d28f921843 (diff)
chat: Add missing return
Without this return it will access invalid memory pointed by msg (that was already freed).
-rw-r--r--src/bin/chat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/chat.c b/src/bin/chat.c
index 241fe39..f0a9ed9 100644
--- a/src/bin/chat.c
+++ b/src/bin/chat.c
@@ -221,7 +221,11 @@ _add_msg(Evas_Object *obj, Message *m)
221 221
222 base = util_add_layout(priv->bx, message_is_outgoing(m) ? 222 base = util_add_layout(priv->bx, message_is_outgoing(m) ?
223 "chat/send" : "chat/recv", "default"); 223 "chat/send" : "chat/recv", "default");
224 if (!base) free(msg); 224 if (!base)
225 {
226 free(msg);
227 return;
228 }
225 229
226 lbl = elm_label_add(base); 230 lbl = elm_label_add(base);
227 elm_label_line_wrap_set(lbl, ELM_WRAP_CHAR); 231 elm_label_line_wrap_set(lbl, ELM_WRAP_CHAR);