fix(core): prevent memory leak in py_execo error path

This commit is contained in:
Nikhil Goyal 2026-04-17 20:45:27 +05:30
parent 5d30381e19
commit 973bbdfea4

View File

@ -159,7 +159,9 @@ bool py_execo(const void* data, int size, const char* filename, py_Ref module) {
CodeObject__dtor(&co); CodeObject__dtor(&co);
return ok; return ok;
} else { } else {
return RuntimeError("bad code object %s: %s", filename, err); bool ok = RuntimeError("bad code object %s: %s", filename, err);
PK_FREE(err);
return ok;
} }
} }