summaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-cmd.c6
-rw-r--r--gdb/python/py-type.c1
2 files changed, 3 insertions, 4 deletions
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index 677c1e416e0..cfddff8d600 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -683,14 +683,12 @@ gdbpy_string_to_argv (PyObject *self, PyObject *args)
if (argp == NULL
|| PyList_Append (py_argv, argp) < 0)
{
- if (argp != NULL)
- {
- Py_DECREF (argp);
- }
+ Py_XDECREF (argp);
Py_DECREF (py_argv);
freeargv (c_argv);
return NULL;
}
+ Py_DECREF (argp);
}
freeargv (c_argv);
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 335342e4871..29b2629c274 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -246,6 +246,7 @@ typy_fields (PyObject *self, PyObject *args)
Py_DECREF (result);
return NULL;
}
+ Py_DECREF (dict);
}
return result;