Skip to content

Commit af71eee

Browse files
committed
gh-109945 fix incorrect reference management of string
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
1 parent ebad50c commit af71eee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/_ssl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4401,12 +4401,13 @@ _ssl__SSLContext_set_ecdh_curve(PySSLContext *self, PyObject *name)
44014401
EC_KEY_free(key);
44024402
#else
44034403
int res = SSL_CTX_set1_groups_list(self->ctx, PyBytes_AS_STRING(name_bytes));
4404-
Py_DECREF(name_bytes);
44054404
if (!res) {
44064405
PyErr_Format(PyExc_ValueError,"unknown elliptic curves %R", name_bytes);
4406+
Py_DECREF(name_bytes);
44074407
_setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
44084408
return NULL;
44094409
}
4410+
Py_DECREF(name_bytes);
44104411
#endif
44114412
Py_RETURN_NONE;
44124413
}

0 commit comments

Comments
 (0)