summaryrefslogtreecommitdiffstats
path: root/gatchat/gatutil.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-03-16 17:22:56 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-03-16 17:22:56 -0500
commit8d9f7fda2eb7b6cffc7cbba3813303bde00c8143 (patch)
tree58219a6aa47e9c2e702c5ca46f4cb25c0b71175e /gatchat/gatutil.c
parent213e1ed65afcca71cee412abcc32dcc8a2ca8783 (diff)
downloadofono-8d9f7fda2eb7b6cffc7cbba3813303bde00c8143.tar.bz2
Fix: Use g_try_malloc in gatutil
Diffstat (limited to 'gatchat/gatutil.c')
-rw-r--r--gatchat/gatutil.c5
1 files changed, 4 insertions, 1 deletions
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';