VidMode: Fix memory leak.

This commit is contained in:
Jon Lund Steffensen
2009-12-25 16:56:07 +01:00
parent f7548343c8
commit 8cf56d115a
+3 -1
View File
@@ -79,7 +79,7 @@ vidmode_set_temperature(int screen_num, int temp, float gamma[3])
}
if (gamma_ramp_size == 0) {
fprintf(stderr, "Error: Gamma ramp size too small: %i\n",
fprintf(stderr, "Gamma ramp size too small: %i\n",
gamma_ramp_size);
XCloseDisplay(dpy);
return -1;
@@ -105,6 +105,8 @@ vidmode_set_temperature(int screen_num, int temp, float gamma[3])
return -1;
}
free(gamma_ramps);
/* Close display */
XCloseDisplay(dpy);