aboutsummaryrefslogtreecommitdiffstats
path: root/src/location-geoclue2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/location-geoclue2.c')
-rw-r--r--src/location-geoclue2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/location-geoclue2.c b/src/location-geoclue2.c
index b012da4..0bb1024 100644
--- a/src/location-geoclue2.c
+++ b/src/location-geoclue2.c
@@ -325,11 +325,13 @@ run_geoclue2_loop(void *state_)
}
static int
-location_geoclue2_init(location_geoclue2_state_t *state)
+location_geoclue2_init(location_geoclue2_state_t **state)
{
#if !GLIB_CHECK_VERSION(2, 35, 0)
g_type_init();
#endif
+ *state = malloc(sizeof(location_geoclue2_state_t));
+ if (*state == NULL) return -1;
return 0;
}
@@ -374,6 +376,8 @@ location_geoclue2_free(location_geoclue2_state_t *state)
state->thread = NULL;
g_mutex_clear(&state->lock);
+
+ free(state);
}
static void