From 6cc32c84934233bf694727df5202c7b2803cdb2e Mon Sep 17 00:00:00 2001 From: Santiago Carot-Nemesio Date: Wed, 25 Jan 2012 14:12:35 +0100 Subject: [PATCH] gatt-service: Move va_end just after processing the argument list --- attrib/gatt-service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c index 187ef5aa4..a5e6dcbe8 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"); -- 2.47.3