[PATCH 2/8] gatt-service: Move va_end just after processing the argument list

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

 



---
 attrib/gatt-service.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index eeda366..d00adb0 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
@@ -307,12 +307,14 @@ gboolean gatt_service_add(struct btd_adapter *adapter, uint16_t uuid,
 
 	va_start(args, opt1);
 	chrs = parse_opts(opt1, args);
+	va_end(args);
+
 	/* calculate how many attributes are necessary for this service */
 	for (l = chrs, size = 1; l != NULL; l = l->next) {
 		struct gatt_info *info = l->data;
 		size += info->num_attrs;
 	}
-	va_end(args);
+
 	start_handle = attrib_db_find_avail(adapter, size);
 	if (start_handle == 0) {
 		error("Not enough free handles to register service");
-- 
1.7.8.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