diff options
author | Po Lu <luangruo@yahoo.com> | 2022-03-07 19:53:52 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-03-07 19:53:52 +0800 |
commit | f2b58db280e28b1ec1607520ef706482e14f6a57 (patch) | |
tree | cd8f9184d18f12da1d4444440187bf745e32cc38 /src/xterm.c | |
parent | 8b66adfe065e0f21ec99c88e3cbb1cb16a94c6cd (diff) | |
download | emacs-f2b58db280e28b1ec1607520ef706482e14f6a57.tar.gz |
Fix color leak
* src/xterm.c (x_alloc_nearest_color_1): Don't allocate colors
multiple times when searching for a closest match.
Diffstat (limited to 'src/xterm.c')
-rw-r--r-- | src/xterm.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c index 0432bd78c6e..1befa97fd14 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3882,12 +3882,8 @@ x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color) temp.red = cells[x].red; temp.green = cells[x].green; temp.blue = cells[x].blue; - status = XAllocColor (dpy, cmap, &temp); - if (status) - { - nearest = x; - nearest_delta = trial_delta; - } + nearest = x; + nearest_delta = trial_delta; } } color->red = cells[nearest].red; |