Fix: Use g_try_malloc in gatutil

This commit is contained in:
Denis Kenzior 2010-03-16 17:22:56 -05:00
parent 213e1ed65a
commit 8d9f7fda2e
1 changed files with 4 additions and 1 deletions

View File

@ -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';