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