From e07cbc7b95c32cbaf9eb8c6cd1fd95eb31123f9f Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Sat, 9 Oct 2010 22:30:40 +0200 Subject: gamma-vidmode.c: Do not call XCloseDisplay() if vidmode_start() fails as XCloseDisplay() will be called in vidmode_free(). --- src/gamma-vidmode.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/gamma-vidmode.c') diff --git a/src/gamma-vidmode.c b/src/gamma-vidmode.c index e6b9412..7b891d8 100644 --- a/src/gamma-vidmode.c +++ b/src/gamma-vidmode.c @@ -68,7 +68,6 @@ vidmode_start(vidmode_state_t *state) if (!r) { fprintf(stderr, _("X request failed: %s\n"), "XF86VidModeQueryVersion"); - XCloseDisplay(state->display); return -1; } @@ -78,14 +77,12 @@ vidmode_start(vidmode_state_t *state) if (!r) { fprintf(stderr, _("X request failed: %s\n"), "XF86VidModeGetGammaRampSize"); - XCloseDisplay(state->display); return -1; } if (state->ramp_size == 0) { fprintf(stderr, _("Gamma ramp size too small: %i\n"), state->ramp_size); - XCloseDisplay(state->display); return -1; } @@ -93,7 +90,6 @@ vidmode_start(vidmode_state_t *state) state->saved_ramps = malloc(3*state->ramp_size*sizeof(uint16_t)); if (state->saved_ramps == NULL) { perror("malloc"); - XCloseDisplay(state->display); return -1; } @@ -108,7 +104,6 @@ vidmode_start(vidmode_state_t *state) if (!r) { fprintf(stderr, _("X request failed: %s\n"), "XF86VidModeGetGammaRamp"); - XCloseDisplay(state->display); return -1; } -- cgit v1.2.3-70-g09d2