haxtibal / netsnmptable

A Python C Extension package to query SNMP tables and table subsets, complementing the original Net-SNMP Python Bindings.
Other
7 stars 0 forks source link

Memory leaks due to missing calls to Py_DECREF and free #3

Closed haxtibal closed 7 years ago

haxtibal commented 7 years ago

In Table.get_entries(), netsnmptable_fetch creates a new reference to the parent netsnmp session, but does not Py_DECREF it again. This prevents the parent netsnmp session from being deallocated by Pythons reference counting / GC.

haxtibal commented 7 years ago

Found some more leaks using valgrind and performing long time tests. Leaks can easily aggregate to hundreds of MBs within days if netsnmptable is used in long running processes to query large tables periodically.