diff --git a/tools/sdptool.c b/tools/sdptool.c
index 458d005..0a949f2 100644
--- a/tools/sdptool.c
+++ b/tools/sdptool.c
break;
}
+ /* Set the subcontext for browsing the sub tree */
+ memcpy(&sub_context, context, sizeof(struct search_context));
+
if (sdp_get_group_id(rec, &sub_context.group) != -1) {
- /* Set the subcontext for browsing the sub tree */
- memcpy(&sub_context, context, sizeof(struct search_context));
/* Browse the next level down if not done */
if (sub_context.group.value.uuid16 != context->group.value.uuid16)
do_search(bdaddr, &sub_context);