From 83d517779b4fe415005cea53a1d2d037013d8caa Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 10 Oct 2012 16:38:22 +0200 Subject: python/progress.cc: check result of Py_BuildValue() too --- python/progress.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python/progress.cc') diff --git a/python/progress.cc b/python/progress.cc index a7fd7ae1..9e870875 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -28,6 +28,8 @@ inline bool setattr(PyObject *object, const char *attr, const char *fmt, T arg) if (!object) return false; PyObject *value = Py_BuildValue(fmt, arg); + if (value == NULL) + return false; int result = PyObject_SetAttrString(object, attr, value); Py_DECREF(value); -- cgit v1.2.3