Visitar URL original
gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing by colorfulappl · Pull Request #99890 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unnecessary null-check
  • Loading branch information
colorfulappl committed Dec 14, 2022
commit 39895eeb7fc7fb0d67ee696e9e2379ce6577a134
6 changes: 2 additions & 4 deletions Python/getargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,8 @@ static int
cleanup_ptr(PyObject *self, void *ptr)
{
void **pptr = (void **)ptr;
if (*pptr) {
PyMem_Free(*pptr);
*pptr = NULL;
}
PyMem_Free(*pptr);
*pptr = NULL;
return 0;
}

Expand Down