TechDraw: Call PyMem_Free() to free allocated buffer

This commit is contained in:
marioalexis
2022-02-07 01:07:25 -03:00
committed by wmayer
parent a0718926d7
commit 9801f76e2f

View File

@@ -955,8 +955,12 @@ private:
if (!PyArg_ParseTuple(args.ptr(), "O|detet", &pFace, &scale, "utf-8", &pPatName, "utf-8", &pPatFile)) {
throw Py::TypeError("expected (face, [scale], [patName], [patFile])");
}
std::string patName = std::string(pPatName);
PyMem_Free(pPatName);
std::string patFile = std::string(pPatFile);
PyMem_Free(pPatFile);
if (PyObject_TypeCheck(pFace, &(TopoShapeFacePy::Type))) {
const TopoDS_Shape& sh = static_cast<TopoShapePy*>(pFace)->getTopoShapePtr()->getShape();
face = TopoDS::Face(sh);