summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-10-10 16:38:22 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-10-10 16:38:22 +0200
commit83d517779b4fe415005cea53a1d2d037013d8caa (patch)
tree3ae511afd6c9171bd1e555ccd5e49be46bd8085c /python
parent1f299c6eef3e5b6e2cd74c27dfd33de41e08f734 (diff)
downloadpython-apt-83d517779b4fe415005cea53a1d2d037013d8caa.tar.gz
python/progress.cc: check result of Py_BuildValue() too
Diffstat (limited to 'python')
-rw-r--r--python/progress.cc2
1 files changed, 2 insertions, 0 deletions
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);