aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-03-02 21:19:54 +0000
committerMichael Snyder <msnyder@vmware.com>2011-03-02 21:19:54 +0000
commit2d5657570debccd1a3294aca26175dd6a7289c14 (patch)
tree0a2c9ac079572455ba2fad8a632d1f690c19430c
parent8c6a60d1e629e93d54e8a004ececd686f6241ade (diff)
downloadgdb-2d5657570debccd1a3294aca26175dd6a7289c14.zip
gdb-2d5657570debccd1a3294aca26175dd6a7289c14.tar.gz
gdb-2d5657570debccd1a3294aca26175dd6a7289c14.tar.bz2
2011-03-02 Michael Snyder <msnyder@vmware.com>
* python/py-inferior.c (build_inferior_list): Error out if PyList_Append fails. (gdbpy_inferiors): Error out if build_inferior_list fails.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/python/py-inferior.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 15c73ad..d3534bf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2011-03-02 Michael Snyder <msnyder@vmware.com>
+ * python/py-inferior.c (build_inferior_list): Error out if
+ PyList_Append fails.
+ (gdbpy_inferiors): Error out if build_inferior_list fails.
+
* linux-nat.c (linux_nat_xfer_partial): Preserve errno around
a function call.
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 12a82d2..ee41ea7 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -326,7 +326,9 @@ build_inferior_list (struct inferior *inf, void *arg)
PyObject *list = arg;
PyObject *inferior = inferior_to_inferior_object (inf);
- PyList_Append (list, inferior);
+ if (PyList_Append (list, inferior))
+ return 1;
+
return 0;
}
@@ -343,7 +345,11 @@ gdbpy_inferiors (PyObject *unused, PyObject *unused2)
if (!list)
return NULL;
- iterate_over_inferiors (build_inferior_list, list);
+ if (iterate_over_inferiors (build_inferior_list, list))
+ {
+ Py_DECREF (list);
+ return NULL;
+ }
return PyList_AsTuple (list);
}