Merge pull request #214 from maandree/null-checks

Remove unnecessary null-checks
This commit is contained in:
Jon Lund Steffensen
2015-05-10 19:43:05 -04:00
3 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -190,8 +190,7 @@ drm_free(drm_state_t *state)
if (state->crtcs != NULL) {
drm_crtc_state_t *crtcs = state->crtcs;
while (crtcs->crtc_num >= 0) {
if (crtcs->r_gamma != NULL)
free(crtcs->r_gamma);
free(crtcs->r_gamma);
crtcs->crtc_num = -1;
crtcs++;
}
+2 -2
View File
@@ -123,8 +123,8 @@ void
location_geoclue_free(location_geoclue_state_t *state)
{
if (state->position != NULL) g_object_unref(state->position);
if (state->provider != NULL) free(state->provider);
if (state->provider_path != NULL) free(state->provider_path);
free(state->provider);
free(state->provider_path);
}
void
+2 -2
View File
@@ -1096,7 +1096,7 @@ main(int argc, char *argv[])
&scheme.night.brightness);
break;
case 'c':
if (config_filepath != NULL) free(config_filepath);
free(config_filepath);
config_filepath = strdup(optarg);
break;
case 'g':
@@ -1245,7 +1245,7 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
if (config_filepath != NULL) free(config_filepath);
free(config_filepath);
/* Read global config settings. */
config_ini_section_t *section = config_ini_get_section(&config_state,