Fix use-after-free bug.

PiperOrigin-RevId: 175564747
This commit is contained in:
Alexandre Passos 2017-11-13 11:47:50 -08:00 committed by TensorFlower Gardener
parent 0a79d4ab6a
commit 6470669cc4

View File

@ -680,7 +680,7 @@ void TFE_Py_TapeRecordOperation(PyObject* tape, PyObject* op_type,
}
}
Py_DECREF(seq);
char* op_type_str = nullptr;
string op_type_str;
if (PyBytes_Check(op_type)) {
op_type_str = PyBytes_AsString(op_type);
} else if (PyUnicode_Check(op_type)) {