Diff between 34c3a51a05733112b89b339cdd7188381aa052b4 and 33c2e6b851308f3333eac398792534f951e63647

Changed Files

File Additions Deletions Status
obexd/client/bluetooth.c +5 -6 modified

Full Patch

diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c
index 589d7a5..8e09d03 100644
--- a/obexd/client/bluetooth.c
+++ b/obexd/client/bluetooth.c
@@ -486,6 +486,7 @@ static const void *bluetooth_getattribute(guint id, int attribute_id)
 		/* Read version since UUID is already known */
 		if (attribute_id == SDP_ATTR_PFILE_DESC_LIST) {
 			sdp_list_t *descs;
+			void *ret = NULL;
 
 			if (sdp_get_profile_descs(session->sdp_record,
 								&descs) < 0)
@@ -493,14 +494,12 @@ static const void *bluetooth_getattribute(guint id, int attribute_id)
 
 			if (descs && descs->data) {
 				sdp_profile_desc_t *desc = descs->data;
-				uint16_t version = desc->version;
-
-				sdp_list_free(descs, free);
-
-				return GINT_TO_POINTER(version);
+				ret = GINT_TO_POINTER(desc->version);
 			}
 
-			return NULL;
+			sdp_list_free(descs, free);
+
+			return ret;
 		}
 
 		data = sdp_data_get(session->sdp_record, attribute_id);