author | Ben Knight <bkk@nerdboy.net.au> | |
Tue, 1 Dec 2009 08:03:27 +0000 (09:03 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 1 Dec 2009 08:03:27 +0000 (09:03 +0100) | ||
commit | bc42a61b1f8e518c7decb824dc61e85d4e9f02b8 | |
tree | 3fdff2f25a6194eb12d4d03b6a4882251606132e | tree | snapshot |
parent | 014985dbc0967cd281bd2e2b88ad16faf21838ae | commit | diff |
src/utils_cmd_listval.c: Free memory returned by `uc_get_names'.
We've run into a memory leak in collectd, triggered by usage of 'listval'
via the unixsock plugin.
When making a 'listval' call, utils_cmd_listval.c:handle_listval() calls
utils_cache.c:uc_get_names() to retrieve a list of active value names from the
internal cache. uc_get_names() uses realloc() to allocate memory in which to
store the list, and returns pointers.
handle_listval() does not perform a free() on the returned memory. Each time
listval is called, some memory is leaked. handle_getval() does not suffer from
the same problem - a free() is called in that case.
We've run into a memory leak in collectd, triggered by usage of 'listval'
via the unixsock plugin.
When making a 'listval' call, utils_cmd_listval.c:handle_listval() calls
utils_cache.c:uc_get_names() to retrieve a list of active value names from the
internal cache. uc_get_names() uses realloc() to allocate memory in which to
store the list, and returns pointers.
handle_listval() does not perform a free() on the returned memory. Each time
listval is called, some memory is leaked. handle_getval() does not suffer from
the same problem - a free() is called in that case.
src/utils_cmd_listval.c | diff | blob | history |