[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2832ad53358e3fbc4bdc601b9f3fa04dd0deae46 by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-36212: Fix two possible reference leaks in the hotshot module 
(GH-12327)
https://github.com/python/cpython/commit/2832ad53358e3fbc4bdc601b9f3fa04dd0deae46


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Charalampos, I merged your PR. I made minor changes in your commit 
message.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Note for myself: Python 3 isn't affected, _hotshot module has been removed from 
Python 3.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
keywords: +patch
pull_requests: +12298
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-06 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

Coverity scan reports a leak on _hotshot.c: 

Python-2.7.15/Modules/_hotshot.c:442: alloc_arg: "unpack_string" allocates 
memory that is stored into "s1".
Python-2.7.15/Modules/_hotshot.c:329:5: alloc_fn: Storage is returned from 
allocation function "PyString_FromStringAndSize".
Python-2.7.15/Objects/stringobject.c:88:5: alloc_fn: Storage is returned from 
allocation function "PyObject_Malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: alloc_fn: Storage is returned from 
allocation function "malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: return_alloc_fn: Directly returning 
storage allocated by "malloc".
Python-2.7.15/Objects/stringobject.c:88:5: var_assign: Assigning: "op" = 
"PyObject_Malloc(37UL + size)".
Python-2.7.15/Objects/stringobject.c:111:5: return_alloc: Returning allocated 
memory "op".
Python-2.7.15/Modules/_hotshot.c:329:5: var_assign: Assigning: "*pvalue" = 
"PyString_FromStringAndSize(buf, len)".
Python-2.7.15/Modules/_hotshot.c:486: leaked_storage: Variable "s1" going out 
of scope leaks the storage it points to.
 484|   result = PyTuple_New(4);
 485|   if (result == NULL)
 486|-> return NULL;
 487|   PyTuple_SET_ITEM(result, 0, PyInt_FromLong(what));
 488|   PyTuple_SET_ITEM(result, 2, PyInt_FromLong(fileno));

--
components: Extension Modules
messages: 337301
nosy: cstratak
priority: normal
severity: normal
status: open
title: [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of 
scope leaks the storage it points to.
type: resource usage
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com