Use g_malloc0 instead of g_try_malloc0 to allocate list. All users expects to get valid pointer from it anyway. Also size of allocated memory is small. --- client/pbap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/pbap.c b/client/pbap.c index 5ec7634..4428c14 100644 --- a/client/pbap.c +++ b/client/pbap.c @@ -632,10 +632,7 @@ static gchar **get_filter_strs(uint64_t filter, gint *size) gint i; gint filter_list_size = sizeof(filter_list) / sizeof(filter_list[0]) - 1; - list = g_try_malloc0(sizeof(gchar **) * (FILTER_BIT_MAX + 2)); - - if (!list) - return NULL; + list = g_malloc0(sizeof(gchar **) * (FILTER_BIT_MAX + 2)); item = list; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html