fix a possible free of a uninitialize variable in paste()
This commit is contained in:
parent
41379f7c39
commit
1cabeda550
6
dmenu.c
6
dmenu.c
|
@ -467,10 +467,12 @@ paste(void)
|
|||
Atom da;
|
||||
|
||||
/* we have been given the current selection, now insert it into input */
|
||||
XGetWindowProperty(dpy, win, utf8, 0, (sizeof text / 4) + 1, False,
|
||||
utf8, &da, &di, &dl, &dl, (unsigned char **)&p);
|
||||
if (XGetWindowProperty(dpy, win, utf8, 0, (sizeof text / 4) + 1, False,
|
||||
utf8, &da, &di, &dl, &dl, (unsigned char **)&p)
|
||||
== Success && p) {
|
||||
insert(p, (q = strchr(p, '\n')) ? q - p : (ssize_t)strlen(p));
|
||||
XFree(p);
|
||||
}
|
||||
drawmenu();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue