From f493c77f9ac37cf17b2206a02cb9192bfa1394b5 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 21 Dec 2012 17:14:21 +0200 Subject: [PATCH] core: Fix btd_profile_remove_custom_prop crash In addition add a boolean return to indicate sucess/failure of the operation. --- src/profile.c | 5 ++++- src/profile.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/profile.c b/src/profile.c index c7c791c20..9c8cfa095 100644 --- a/src/profile.c +++ b/src/profile.c @@ -2235,7 +2235,7 @@ static void free_property(gpointer data) g_free(p); } -void btd_profile_remove_custom_prop(const char *uuid, const char *name) +bool btd_profile_remove_custom_prop(const char *uuid, const char *name) { GSList *l; @@ -2250,7 +2250,10 @@ void btd_profile_remove_custom_prop(const char *uuid, const char *name) custom_props = g_slist_delete_link(custom_props, l); free_property(prop); + return true; } + + return false; } void btd_profile_init(void) diff --git a/src/profile.h b/src/profile.h index fe332d99a..27ccdd3a4 100644 --- a/src/profile.h +++ b/src/profile.h @@ -72,7 +72,7 @@ void btd_profile_add_custom_prop(const char *uuid, const char *type, btd_profile_prop_exists exists, btd_profile_prop_get get, void *user_data); -void btd_profile_remove_custom_prop(const char *uuid, const char *name); +bool btd_profile_remove_custom_prop(const char *uuid, const char *name); void btd_profile_init(void); void btd_profile_cleanup(void); -- 2.47.3