diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2014-06-24 15:07:44 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-06-25 12:26:11 +0300 |
commit | 333dacef05b7a5cb7266a6508deedb3632229295 (patch) | |
tree | 11282d62890241a4a13b4ba16542ed986108d882 /profiles/health | |
parent | ba5442362d498ebc38deb435ab9dc7045e5ad6f2 (diff) | |
download | bluez-333dacef05b7a5cb7266a6508deedb3632229295.tar.gz |
HDP: Fix possible memory leak
Diffstat (limited to 'profiles/health')
-rw-r--r-- | profiles/health/hdp_util.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/profiles/health/hdp_util.c b/profiles/health/hdp_util.c index 5676eee88..e3e0830d1 100644 --- a/profiles/health/hdp_util.c +++ b/profiles/health/hdp_util.c @@ -598,6 +598,13 @@ fail: return NULL; } +static void free_hdp_list(void *list) +{ + sdp_list_t *hdp_list = list; + + sdp_list_free(hdp_list, (sdp_free_func_t)sdp_data_free); +} + static gboolean register_features(struct hdp_application *app, sdp_list_t **sup_features) { @@ -620,16 +627,11 @@ static gboolean register_features(struct hdp_application *app, fail: if (hdp_feature != NULL) sdp_list_free(hdp_feature, (sdp_free_func_t)sdp_data_free); + if (*sup_features != NULL) + sdp_list_free(*sup_features, free_hdp_list); return FALSE; } -static void free_hdp_list(void *list) -{ - sdp_list_t *hdp_list = list; - - sdp_list_free(hdp_list, (sdp_free_func_t)sdp_data_free); -} - static gboolean register_service_sup_features(GSList *app_list, sdp_record_t *sdp_record) { |