summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfsbs <fsbs@users.noreply.github.com>2021-11-03 09:49:48 +0100
committerfsbs <fsbs@users.noreply.github.com>2021-11-03 09:49:48 +0100
commit13de1dd5ac1b871834468754ca4a409a8358fae3 (patch)
treec26d3ee1fb49a0be3150f313d331ed9b540b916e
parentf84bc67cb6e8be6674cd0eeea1bc7c09561f12c8 (diff)
downloadpycurl-13de1dd5ac1b871834468754ca4a409a8358fae3.tar.gz
Revert "do_curl_duphandle: fix clearing dict on error"
At the "error" label dup is already allocated, otherwise the function returns instead of going to "error". Thus Py_CLEAR(dup->dict) can be called without checking if dup != NULL. This reverts commit 9fd19c97f4be2ca0ca8910b44bea74d593e65ecb.
-rw-r--r--src/easy.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/easy.c b/src/easy.c
index 1536ccb..2b1e296 100644
--- a/src/easy.c
+++ b/src/easy.c
@@ -416,9 +416,7 @@ do_curl_duphandle(CurlObject *self)
return dup;
error:
- if (dup != NULL) {
- Py_CLEAR(dup->dict);
- }
+ Py_CLEAR(dup->dict);
Py_DECREF(dup); /* this also closes dup->handle */
PyErr_SetString(ErrorObject, "cloning curl failed");
return NULL;