Message170139
| Author |
christian.heimes |
| Recipients |
christian.heimes |
| Date |
2012年09月09日.22:09:57 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1347228598.43.0.424519630485.issue15893@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In Python/frozenmain.c the function Py_FrozenMain() doesn't handle argv_copy and argv_copy2 correctly. Both variables contain memory that is allocated with PyMem_Malloc(). argv_copy2 is never checked for NULL and both variables are not correctly cleaned up in error cases.
CID 486834: Resource leak (RESOURCE_LEAK)At (11): Variable "argv_copy" going out of scope leaks the storage it points to.
CID 486835: Resource leak (RESOURCE_LEAK)At (9): Variable "argv_copy2" going out of scope leaks the storage it points to.
Suggested fix:
Separate var declaration from PyMem_Malloc() calls and use a goto label to clean up the variables and its content at the end of the function. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月09日 22:09:58 | christian.heimes | set | recipients:
+ christian.heimes |
| 2012年09月09日 22:09:58 | christian.heimes | set | messageid: <1347228598.43.0.424519630485.issue15893@psf.upfronthosting.co.za> |
| 2012年09月09日 22:09:57 | christian.heimes | link | issue15893 messages |
| 2012年09月09日 22:09:57 | christian.heimes | create |
|