diff options
author | fsbs <fsbs@users.noreply.github.com> | 2021-11-03 09:49:48 +0100 |
---|---|---|
committer | fsbs <fsbs@users.noreply.github.com> | 2021-11-03 09:49:48 +0100 |
commit | 13de1dd5ac1b871834468754ca4a409a8358fae3 (patch) | |
tree | c26d3ee1fb49a0be3150f313d331ed9b540b916e | |
parent | f84bc67cb6e8be6674cd0eeea1bc7c09561f12c8 (diff) | |
download | pycurl-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.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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; |