devdraw: fix some memory leaks in x11
This commit is contained in:
parent
7ca1c90109
commit
b2f6769830
2 changed files with 5 additions and 1 deletions
|
|
@ -176,6 +176,7 @@ _xattach(char *label, char *winsize)
|
|||
}
|
||||
}
|
||||
}
|
||||
XFree(pfmt);
|
||||
if(_x.chan == 0){
|
||||
werrstr("could not determine screen pixel format");
|
||||
goto err0;
|
||||
|
|
@ -232,6 +233,7 @@ _xattach(char *label, char *winsize)
|
|||
geom = smprint("%s.geometry", label);
|
||||
if(geom && XrmGetResource(database, geom, nil, &geomrestype, &geomres))
|
||||
mask = XParseGeometry(geomres.addr, &x, &y, (uint*)&width, (uint*)&height);
|
||||
XrmDestroyDatabase(database);
|
||||
free(geom);
|
||||
|
||||
if((mask & WidthValue) && (mask & HeightValue)){
|
||||
|
|
|
|||
|
|
@ -431,8 +431,10 @@ _xgetsnarffrom(XWindow w, Atom clipboard, Atom target, int timeout0, int timeout
|
|||
usleep(10*1000);
|
||||
XGetWindowProperty(_x.display, _x.drawable, prop, 0, 0, 0, AnyPropertyType,
|
||||
&type, &fmt, &dummy, &len, &xdata);
|
||||
if(lastlen == len && len > 0)
|
||||
if(lastlen == len && len > 0){
|
||||
XFree(xdata);
|
||||
break;
|
||||
}
|
||||
lastlen = len;
|
||||
XFree(xdata);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue