diff options
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 7c3d33ab..cf294c01 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -241,6 +241,9 @@ def _encode_general_names(backend, names): def _encode_subject_alt_name(backend, san): general_names = _encode_general_names(backend, san) + general_names = backend._ffi.gc( + general_names, backend._lib.GENERAL_NAMES_free + ) pp = backend._ffi.new("unsigned char **") r = backend._lib.i2d_GENERAL_NAMES(general_names, pp) assert r > 0 |