diff options
author | fsbs <fsbs@users.noreply.github.com> | 2021-11-03 08:23:01 +0000 |
---|---|---|
committer | fsbs <fsbs@users.noreply.github.com> | 2021-11-03 09:23:01 +0100 |
commit | 9fd19c97f4be2ca0ca8910b44bea74d593e65ecb (patch) | |
tree | 6e8b565398c7d6996a7c4adbea9c32c0571e9eb6 | |
parent | 6beb8325eb269e1f24a0fd58bc6d776bf988da3a (diff) | |
download | pycurl-9fd19c97f4be2ca0ca8910b44bea74d593e65ecb.tar.gz |
do_curl_duphandle: fix clearing dict on error
-rw-r--r-- | src/easy.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -416,7 +416,9 @@ do_curl_duphandle(CurlObject *self) return dup; error: - Py_CLEAR(dup->dict); + if (dup != NULL) { + Py_CLEAR(dup->dict); + } Py_DECREF(dup); /* this also closes dup->handle */ PyErr_SetString(ErrorObject, "cloning curl failed"); return NULL; |