diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-03-16 17:22:56 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-03-16 17:22:56 -0500 |
commit | 8d9f7fda2eb7b6cffc7cbba3813303bde00c8143 (patch) | |
tree | 58219a6aa47e9c2e702c5ca46f4cb25c0b71175e /gatchat/gatutil.c | |
parent | 213e1ed65afcca71cee412abcc32dcc8a2ca8783 (diff) | |
download | ofono-8d9f7fda2eb7b6cffc7cbba3813303bde00c8143.tar.bz2 |
Fix: Use g_try_malloc in gatutil
Diffstat (limited to 'gatchat/gatutil.c')
-rw-r--r-- | gatchat/gatutil.c | 5 |
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'; |