|
@@ -305,8 +305,9 @@ Term_repr (PyObject *self)
|
|
|
TermObject *term_obj = (TermObject *)self;
|
|
|
LSUP_Term *term = term_obj->ob_struct;
|
|
|
char *term_repr_ptn = "<%s @%p> '%s'";
|
|
|
- char *term_nt;
|
|
|
+ char *term_nt = NULL;
|
|
|
if (UNLIKELY (nt_codec.encode_term (term, NULL, &term_nt) != LSUP_OK)) {
|
|
|
+ free (term_nt);
|
|
|
PyErr_SetString (PyExc_ValueError, "Error serializing term.");
|
|
|
return NULL;
|
|
|
}
|
|
@@ -319,6 +320,7 @@ Term_repr (PyObject *self)
|
|
|
sprintf (
|
|
|
term_repr, term_repr_ptn,
|
|
|
self->ob_type->tp_name, term_obj, term_nt);
|
|
|
+ free (term_nt);
|
|
|
|
|
|
PyObject *result = PyUnicode_FromString (term_repr);
|
|
|
free (term_repr);
|