Merge pull request #214 from maandree/null-checks
Remove unnecessary null-checks
This commit is contained in:
+1
-2
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user