From b933b617af81c312f63a59c1b61c54221901de5c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 12 May 2014 18:32:29 +0200 Subject: Check for strdup failure in location-geoclue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/location-geoclue.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2