release prop objects after they have been retained by dictionary

This commit is contained in:
plunky 2007-04-11 20:01:01 +00:00
parent 51bb5141d1
commit 6b1f9646c6

View File

@ -1,4 +1,4 @@
/* $NetBSD: sdp.c,v 1.1 2006/09/10 15:45:56 plunky Exp $ */
/* $NetBSD: sdp.c,v 1.2 2007/04/11 20:01:01 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: sdp.c,v 1.1 2006/09/10 15:45:56 plunky Exp $");
__RCSID("$NetBSD: sdp.c,v 1.2 2007/04/11 20:01:01 plunky Exp $");
#include <sys/types.h>
@ -268,22 +268,32 @@ config_hid(prop_dictionary_t dict)
if (obj == NULL || !prop_dictionary_set(dict, BTDEVtype, obj))
return errno;
prop_object_release(obj);
obj = prop_number_create_integer(control_psm);
if (obj == NULL || !prop_dictionary_set(dict, BTHIDEVcontrolpsm, obj))
return errno;
prop_object_release(obj);
obj = prop_number_create_integer(interrupt_psm);
if (obj == NULL || !prop_dictionary_set(dict, BTHIDEVinterruptpsm, obj))
return errno;
prop_object_release(obj);
obj = prop_data_create_data(hid_descriptor, hid_length);
if (obj == NULL || !prop_dictionary_set(dict, BTHIDEVdescriptor, obj))
return errno;
prop_object_release(obj);
if (!reconnect_initiate) {
obj = prop_bool_create(TRUE);
if (obj == NULL || !prop_dictionary_set(dict, BTHIDEVreconnect, obj))
return errno;
prop_object_release(obj);
}
return 0;
@ -319,10 +329,14 @@ config_hset(prop_dictionary_t dict)
if (obj == NULL || !prop_dictionary_set(dict, BTDEVtype, obj))
return errno;
prop_object_release(obj);
obj = prop_number_create_integer(channel);
if (obj == NULL || !prop_dictionary_set(dict, BTSCOchannel, obj))
return errno;
prop_object_release(obj);
return 0;
}
@ -356,14 +370,20 @@ config_hf(prop_dictionary_t dict)
if (obj == NULL || !prop_dictionary_set(dict, BTDEVtype, obj))
return errno;
prop_object_release(obj);
obj = prop_bool_create(TRUE);
if (obj == NULL || !prop_dictionary_set(dict, BTSCOlisten, obj))
return errno;
prop_object_release(obj);
obj = prop_number_create_integer(channel);
if (obj == NULL || !prop_dictionary_set(dict, BTSCOchannel, obj))
return errno;
prop_object_release(obj);
return 0;
}