devdraw: fix some memory leaks in x11

This commit is contained in:
Xiao-Yong Jin 2018-03-20 22:16:17 -05:00 committed by David du Colombier
parent 7ca1c90109
commit b2f6769830
2 changed files with 5 additions and 1 deletions

View file

@ -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)){