diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2010-08-04 11:03:28 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2010-08-09 18:06:49 -0400 |
commit | a9a4e52bee4f35d67ee416009b561149519bbf56 (patch) | |
tree | 0f577f80f0e3940b83de5aca295b2eed3d844dc1 /attrib | |
parent | 08e83df251524a9f6d6481a54a0f65de88277bdc (diff) | |
download | bluez-a9a4e52bee4f35d67ee416009b561149519bbf56.tar.gz bluez-a9a4e52bee4f35d67ee416009b561149519bbf56.tar.xz bluez-a9a4e52bee4f35d67ee416009b561149519bbf56.zip |
Fix wrong paths for the Services objects
When restoring the Service information from storage, the path was created
before reading the information from storage.
Diffstat (limited to 'attrib')
-rw-r--r-- | attrib/client.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/attrib/client.c b/attrib/client.c index 3a73337f..dd9dec65 100644 --- a/attrib/client.c +++ b/attrib/client.c @@ -446,13 +446,17 @@ static GSList *string_to_primary_list(char *gatt_path, const char *str) int ret; prim = g_new0(struct primary, 1); - prim->path = g_strdup_printf("%s/service%04x", gatt_path, - prim->start); ret = sscanf(services[i], "%04hX#%04hX#%s", &prim->start, &prim->end, uuidstr); - if (ret < 3) + + if (ret < 3) { + g_free(prim); continue; + } + + prim->path = g_strdup_printf("%s/service%04x", gatt_path, + prim->start); bt_string2uuid(&prim->uuid, uuidstr); |