From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4 Description of problem: When using an external send program (-e), nanny fails to deallocate the result buffer and leaks memory upon every external invocation. Version-Release number of selected component (if applicable): piranha-0.7.0 through piranha-0.8.1 How reproducible: Always Steps to Reproduce: 1. start a nanny instance with a verbose external check program executed often (1s): nanny -c -h 192.168.0.0 -p 1234 -e /sbin/lspci -x BLAH -q -t 1 --lvs& 2. watch the process memory footprint watch -n1 "cat /proc/$(PID)/status" Actual Results: The memory footprint continues to grow indefinitely. Expected Results: The memory footprint should stabilize. Additional info: The actual leak is in nanny.c::external_check() which fails to deallocate the "result" buffer allocated by getExecOutput() using strdup: result = getExecOutput (flags, argv, timeout); if (expect_str != NULL) { if (strcmp (expect_str, result) != 0) { piranha_log (flags, (char *) "Trouble. Recieved results are not what we expected from (%s)\n", inet_ntoa (*remoteAddr)); return 1; } else { return 0; } } A patch will be available shortly.
Created attachment 121522 [details] Fix for the nanny memory leak.
Patch looks correct.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2006-0255.html