aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2014-05-16 00:32:45 +0200
committerJon Lund Steffensen <jonlst@gmail.com>2014-05-16 00:32:45 +0200
commit1d1379b6a27676857789efcaa9bfd177989ec0b0 (patch)
tree24458c760daaf66fa9776ea9e4fbcf3386873f8a
parentHACKING: Add notes on packaging, cross-compiling (diff)
parentCheck for strdup failure in location-geoclue (diff)
downloadredshift-ng-1d1379b6a27676857789efcaa9bfd177989ec0b0.tar.gz
redshift-ng-1d1379b6a27676857789efcaa9bfd177989ec0b0.tar.bz2
redshift-ng-1d1379b6a27676857789efcaa9bfd177989ec0b0.tar.xz
Merge pull request #84 from maandree/geoclue-strdup-failure
Check for strdup failure in location-geoclue
-rw-r--r--src/location-geoclue.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/location-geoclue.c b/src/location-geoclue.c
index 5c027c7..07865c5 100644
--- a/src/location-geoclue.c
+++ b/src/location-geoclue.c
@@ -159,6 +159,10 @@ location_geoclue_set_option(location_geoclue_state_t *state,
}
state->provider = strdup(provider);
+ if (state->provider == NULL) {
+ perror("strdup");
+ return -1;
+ }
} else if (strcasecmp(key, "path") == 0) {
if (value != NULL && strcasecmp(value, "default") == 0) {
path = DEFAULT_PROVIDER_PATH;
@@ -167,6 +171,10 @@ location_geoclue_set_option(location_geoclue_state_t *state,
}
state->provider_path = strdup(path);
+ if (state->provider_path == NULL) {
+ perror("strdup");
+ return -1;
+ }
} else {
fprintf(stderr, _("Unknown method parameter: `%s'.\n"), key);
return -1;