From 8d9f7fda2eb7b6cffc7cbba3813303bde00c8143 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 16 Mar 2010 17:22:56 -0500 Subject: [PATCH] Fix: Use g_try_malloc in gatutil --- gatchat/gatutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gatchat/gatutil.c b/gatchat/gatutil.c index 7ca1d3f9..575019d6 100644 --- a/gatchat/gatutil.c +++ b/gatchat/gatutil.c @@ -60,7 +60,10 @@ void g_at_util_debug_chat(gboolean in, const char *str, gsize len, escaped += 4; } - escaped_str = g_malloc(escaped + 1); + escaped_str = g_try_malloc(escaped + 1); + if (escaped_str == NULL) + return; + escaped_str[0] = type; escaped_str[1] = ' '; escaped_str[2] = '\0';