VidMode: Fix memory leak.
This commit is contained in:
+3
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user