memory leak in memcached_servers_parse
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
Fix Released
|
Medium
|
Brian Aker |
Bug Description
#include <libmemcached/
int main() {
memcached_
memcached_
return 0;
}
gcc leak_test.c -lmemcached -lm -o leak_test
use valgrind we got:
==10925== 17,516 bytes in 1 blocks are definitely lost in loss record 1 of 1
==10925== at 0x4025BD3: malloc (vg_replace_
==10925== by 0x4025C5D: realloc (vg_replace_
==10925== by 0x80494FD: memcached_
==10925== by 0x8048EFF: memcached_
==10925== by 0x8048D88: main (in ...../leak_test)
maybe reason:
memcached_
memcached_
patch attached, wish helped.
Ken
Changed in libmemcached: | |
assignee: | nobody → Brian Aker (brianaker) |
importance: | Undecided → Medium |
Changed in libmemcached: | |
status: | New → Fix Committed |
Changed in libmemcached: | |
status: | Fix Committed → Fix Released |
Thanks, when I try your patch out I get the following:
#0 memcached_ server_ free (self=<value optimized out>) at libmemcached/ server. c:118 bug_728286 (unused=<value optimized out>) at tests/mem_ functions. c:6130
#1 0x0000000000409a46 in regression_
When free is called if root is not set in the structure we get a crash. I've added an if() to that to solve the issue.
I should have this in trunk sometime in the next 24hours.
Thanks again.