From b27acd687800499324381648036edd098c996524 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Wed, 11 Oct 2017 20:36:41 -0700 Subject: Allocate module data in init functions --- src/location-corelocation.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/location-corelocation.m') diff --git a/src/location-corelocation.m b/src/location-corelocation.m index 17e0054..bf60507 100644 --- a/src/location-corelocation.m +++ b/src/location-corelocation.m @@ -173,8 +173,10 @@ pipe_close_callback( static int -location_corelocation_init(location_corelocation_state_t *state) +location_corelocation_init(location_corelocation_state_t **state) { + *state = malloc(sizeof(location_corelocation_state_t)); + if (*state == NULL) return -1; return 0; } @@ -223,6 +225,7 @@ location_corelocation_free(location_corelocation_state_t *state) } free(state->private); + free(state); } static void -- cgit v1.2.3-70-g09d2