aboutsummaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index c3e3cf155b..9d6483f4fe 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -202,9 +202,9 @@ _PyArg_VaParse_SizeT(PyObject *args, const char *format, va_list va)
static int
cleanup_ptr(PyObject *self, void *ptr)
{
- if (ptr) {
- PyMem_Free(ptr);
- }
+ void **pptr = (void **)ptr;
+ PyMem_Free(*pptr);
+ *pptr = NULL;
return 0;
}
@@ -1169,7 +1169,7 @@ _Py_COMP_DIAG_POP
PyErr_NoMemory();
RETURN_ERR_OCCURRED;
}
- if (addcleanup(*buffer, freelist, cleanup_ptr)) {
+ if (addcleanup(buffer, freelist, cleanup_ptr)) {
Py_DECREF(s);
return converterr(
"(cleanup problem)",
@@ -1215,7 +1215,7 @@ _Py_COMP_DIAG_POP
PyErr_NoMemory();
RETURN_ERR_OCCURRED;
}
- if (addcleanup(*buffer, freelist, cleanup_ptr)) {
+ if (addcleanup(buffer, freelist, cleanup_ptr)) {
Py_DECREF(s);
return converterr("(cleanup problem)",
arg, msgbuf, bufsize);