aboutsummaryrefslogtreecommitdiffstats
path: root/src/location-corelocation.m
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2017-10-11 20:36:41 -0700
committerJon Lund Steffensen <jonlst@gmail.com>2017-10-13 18:09:28 -0700
commitb27acd687800499324381648036edd098c996524 (patch)
tree3197172546126fff94e8918ad2244f0788f60ee7 /src/location-corelocation.m
parentMove module struct definitions to separate files (diff)
downloadredshift-ng-b27acd687800499324381648036edd098c996524.tar.gz
redshift-ng-b27acd687800499324381648036edd098c996524.tar.bz2
redshift-ng-b27acd687800499324381648036edd098c996524.tar.xz
Allocate module data in init functions
Diffstat (limited to 'src/location-corelocation.m')
-rw-r--r--src/location-corelocation.m5
1 files changed, 4 insertions, 1 deletions
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