Eliminated potential memory leak.

This commit is contained in:
Anthony Tuininga 2016-01-27 15:04:37 -07:00
parent 2da756e0cc
commit 6b5b9887f8

View File

@ -169,8 +169,10 @@ static int Environment_SetBuffer(
obj = cxString_FromAscii(value);
if (!obj)
return -1;
if (cxBuffer_FromObject(buf, obj, encoding)<0)
if (cxBuffer_FromObject(buf, obj, encoding) < 0) {
Py_DECREF(obj);
return -1;
}
Py_CLEAR(obj);
return 0;