Browse Source

fix memory leak in xloadcols()

reported by Avi Halachmi (:avih)" <avihpit@yahoo.com>

patch slightly changed by me.
master
Hiltjo Posthuma 6 years ago
parent
commit
d7bf023b2f
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      x.c

+ 3
- 3
x.c View File

@ -733,12 +733,12 @@ xloadcols(void)
static int loaded;
Color *cp;
dc.collen = MAX(LEN(colorname), 256);
dc.col = xmalloc(dc.collen * sizeof(Color));
if (loaded) {
for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp)
XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);
} else {
dc.collen = MAX(LEN(colorname), 256);
dc.col = xmalloc(dc.collen * sizeof(Color));
}
for (i = 0; i < dc.collen; i++)


Loading…
Cancel
Save