From a06299a279efcb3f48ad0760a15f75d1d9ac87e2 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 29 Apr 2013 16:27:51 +0300 Subject: [PATCH] proximity: Fix btd_device_get_storage_path failure handling --- profiles/proximity/monitor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c index 48f877d8b..eaa5b0db7 100644 --- a/profiles/proximity/monitor.c +++ b/profiles/proximity/monitor.c @@ -109,6 +109,10 @@ static void write_proximity_config(struct btd_device *device, const char *alert, gsize length = 0; filename = btd_device_get_storage_path(device, "proximity"); + if (!filename) { + warn("Unable to get proximity storage path for device"); + return; + } key_file = g_key_file_new(); g_key_file_load_from_file(key_file, filename, 0, NULL); @@ -136,6 +140,10 @@ static char *read_proximity_config(struct btd_device *device, const char *alert) char *str; filename = btd_device_get_storage_path(device, "proximity"); + if (!filename) { + warn("Unable to get proximity storage path for device"); + return NULL; + } key_file = g_key_file_new(); g_key_file_load_from_file(key_file, filename, 0, NULL); -- 2.47.3