diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-08-06 18:21:38 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-08-06 18:21:38 -0400 |
commit | 2472d666c3261c85615393e729705558ce75f746 (patch) | |
tree | 83421c3c63dda46288dee9f59190bdf867a99c0f | |
parent | 87f9207a756a10dd9eebd59d39769463c0f8d8e5 (diff) | |
parent | 6477d4807d2b238412da9669875f0e9fed24826c (diff) | |
download | cryptography-2472d666c3261c85615393e729705558ce75f746.tar.gz cryptography-2472d666c3261c85615393e729705558ce75f746.tar.bz2 cryptography-2472d666c3261c85615393e729705558ce75f746.zip |
Merge pull request #2222 from reaperhulk/memleak-partdeux
X509_add_ext dupes the X509_EXTENSION when adding it. fix the leak
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 40fcad73..0038ddb0 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -1187,6 +1187,8 @@ class Backend(object): 1 if extension.critical else 0, _encode_asn1_str_gc(self, pp[0], r) ) + assert extension != self._ffi.NULL + extension = self._ffi.gc(extension, self._lib.X509_EXTENSION_free) res = self._lib.X509_add_ext(x509_cert, extension, i) assert res == 1 |