This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年09月19日 22:01 by Daniel.Sommermann, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| npn_memfix.patch | christian.heimes, 2012年09月20日 01:02 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg170774 - (view) | Author: Daniel Sommermann (Daniel.Sommermann) | Date: 2012年09月19日 22:01 | |
I noticed that the function _set_npn_protocols() has the following line: self->npn_protocols = PyMem_Malloc(protos.len); There is no check to see if self->npn_protocols is already allocated. Thus, multiple calls to _set_npn_protocols() will leak memory. There should be a check to see if it is non-null and free the memory pointed to by self->npn_protocols before the malloc unless I am missing something. |
|||
| msg170779 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年09月20日 01:02 | |
You are right. I did some testing and the function indeed leaks memory. The attached patch fixes the issue for me. |
|||
| msg170793 - (view) | Author: Daniel Sommermann (Daniel.Sommermann) | Date: 2012年09月20日 07:01 | |
This patch looks good to me (it's exactly how I fixed it in my local build), although I'm not sure how to approve your patch so you can push it to the upstream. |
|||
| msg170796 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年09月20日 10:43 | |
New changeset 2bdc8c8ea42e by Christian Heimes in branch 'default': Issue #15977: Fix memory leak in Modules/_ssl.c when the function _set_npn_protocols() is called multiple times http://hg.python.org/cpython/rev/2bdc8c8ea42e |
|||
| msg170797 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年09月20日 10:49 | |
Georg, here is another candidate for the new release candidate. Daniel, two equal patches are good enough as a patch review. The fix is simple and straight forward, too. Thanks for your report! |
|||
| msg170960 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年09月22日 06:56 | |
Picked. |
|||
| msg171098 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年09月24日 05:46 | |
New changeset 4cf53684e14e by Christian Heimes in branch 'default': Issue #15977: Fix memory leak in Modules/_ssl.c when the function _set_npn_protocols() is called multiple times http://hg.python.org/cpython/rev/4cf53684e14e |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:36 | admin | set | github: 60181 |
| 2012年09月24日 05:46:48 | python-dev | set | messages: + msg171098 |
| 2012年09月22日 06:56:20 | georg.brandl | set | status: pending -> closed messages: + msg170960 |
| 2012年09月20日 10:49:38 | christian.heimes | set | status: open -> pending assignee: georg.brandl nosy: + georg.brandl messages: + msg170797 resolution: fixed stage: patch review -> resolved |
| 2012年09月20日 10:43:56 | python-dev | set | nosy:
+ python-dev messages: + msg170796 |
| 2012年09月20日 07:01:14 | Daniel.Sommermann | set | messages: + msg170793 |
| 2012年09月20日 03:01:50 | jcea | set | type: resource usage stage: patch review |
| 2012年09月20日 03:01:25 | jcea | set | nosy:
+ jcea type: resource usage -> (no value) stage: patch review -> (no value) |
| 2012年09月20日 01:02:34 | christian.heimes | set | files:
+ npn_memfix.patch type: resource usage keywords: + patch nosy: + christian.heimes messages: + msg170779 stage: patch review |
| 2012年09月19日 22:01:59 | Daniel.Sommermann | create | |