Clear the object prior to fetching; otherwise, OCI will try to do something

with it and potentially crash the application!
This commit is contained in:
Anthony Tuininga 2017-01-12 11:49:28 -07:00
parent 6ef66ec3d6
commit 9fe01bd90b

View File

@ -225,10 +225,13 @@ static int ObjectVar_PreFetch(
ub4 i;
for (i = 0; i < var->allocatedElements; i++) {
if (var->objects[i])
Py_CLEAR(var->objects[i]);
if (var->data[i])
else if (var->data[i])
OCIObjectFree(var->environment->handle,
var->environment->errorHandle, var->data[i], OCI_DEFAULT);
var->data[i] = NULL;
var->objectIndicator[i] = NULL;
}
return 0;