summaryrefslogtreecommitdiffstats
path: root/gobject/pygtype.c
diff options
context:
space:
mode:
Diffstat (limited to 'gobject/pygtype.c')
-rw-r--r--gobject/pygtype.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index aff6287..3915f8f 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -907,7 +907,8 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj)
GString *string;
char *buffer;
Py_ssize_t len;
- if (_PyUnicode_AsStringAndSize(obj, &buffer, &len))
+ buffer = _PyUnicode_AsStringAndSize(obj, &buffer, &len);
+ if (buffer == NULL)
return -1;
string = g_string_new_len(buffer, len);
g_value_set_boxed(value, string);