[PATCH obexd 2/7] client: Use g_malloc0 in get_filter_strs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux