This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 04/28] add missing decref in before_prompt_hook


The checker noticed a missing decref in before_prompt_hook.

	* python/python.c (before_prompt_hook): Add cleanup to
	decref 'hook'.
---
 gdb/python/python.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/python/python.c b/gdb/python/python.c
index 67d06e5..5ef9e0a 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -900,6 +900,8 @@ before_prompt_hook (const char *current_gdb_prompt)
       if (hook == NULL)
 	goto fail;
 
+      make_cleanup_py_decref (hook);
+
       if (PyCallable_Check (hook))
 	{
 	  PyObject *result;
-- 
1.8.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]