projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
213e1ed
)
Fix: Use g_try_malloc in gatutil
author
Denis Kenzior
<denkenz@gmail.com>
Tue, 16 Mar 2010 22:22:56 +0000
(17:22 -0500)
committer
Denis Kenzior
<denkenz@gmail.com>
Tue, 16 Mar 2010 22:22:56 +0000
(17:22 -0500)
gatchat/gatutil.c
patch
|
blob
|
history
diff --git
a/gatchat/gatutil.c
b/gatchat/gatutil.c
index
7ca1d3f
..
575019d
100644
(file)
--- 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';