summaryrefslogtreecommitdiffstats
path: root/sdpd/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'sdpd/service.c')
-rw-r--r--sdpd/service.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sdpd/service.c b/sdpd/service.c
index 0b4b0d8e..83844d68 100644
--- a/sdpd/service.c
+++ b/sdpd/service.c
@@ -353,11 +353,15 @@ int service_register_req(sdp_req_t *req, sdp_buf_t *rsp)
if (rec->handle == 0xffffffff) {
rec->handle = sdp_next_handle();
- if (rec->handle < 0x10000)
+ if (rec->handle < 0x10000) {
+ sdp_record_free(rec);
goto invalid;
+ }
} else {
- if (sdp_record_find(rec->handle))
+ if (sdp_record_find(rec->handle)) {
+ sdp_record_free(rec);
goto invalid;
+ }
}
sdp_record_add(&req->device, rec);