summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-06-17 09:40:56 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2010-06-17 09:40:56 +0300
commitb336e93a471f4ede121edaf822cd525c2ffc17a7 (patch)
treeadd08bc5de6d60b445229e9906750a1c9298637d /audio
parented3773ab5d7825a84bd12f43be7e082edaaf6201 (diff)
downloadbluez-b336e93a471f4ede121edaf822cd525c2ffc17a7.tar.gz
Fix memory leak
Diffstat (limited to 'audio')
-rw-r--r--audio/manager.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/audio/manager.c b/audio/manager.c
index f6a98cd06..5edfb1807 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -351,12 +351,18 @@ static sdp_record_t *hfp_ag_record(uint8_t ch, uint32_t feat)
sdp_data_t *channel, *features;
uint8_t netid = 0x01;
uint16_t sdpfeat;
- sdp_data_t *network = sdp_data_alloc(SDP_UINT8, &netid);
+ sdp_data_t *network;
record = sdp_record_alloc();
if (!record)
return NULL;
+ network = sdp_data_alloc(SDP_UINT8, &netid);
+ if (!network) {
+ sdp_record_free(record);
+ return NULL;
+ }
+
sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
root = sdp_list_append(0, &root_uuid);
sdp_set_browse_groups(record, root);