Date: Fri, 24 Sep 2010 06:51:02 +0300 From: Mikolaj Golub <to.my.trociny@gmail.com> To: freebsd-fs@freebsd.org Subject: hastd: memory leaks if fork() fails Message-ID: <86mxr7x0ih.fsf@kopusha.home.net>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Although it is rather unlikely situation but anyway :-)
If fork() fails in hook_execv() hastd leaks some bytes referred by hp. See the
attached patch.
--
Mikolaj Golub
[-- Attachment #2 --]
Index: sbin/hastd/hooks.c
===================================================================
--- sbin/hastd/hooks.c (revision 213027)
+++ sbin/hastd/hooks.c (working copy)
@@ -388,6 +388,7 @@ hook_execv(const char *path, va_list ap)
switch (pid) {
case -1: /* Error. */
pjdlog_errno(LOG_ERR, "Unable to fork to execute %s", path);
+ hook_free(hp);
return;
case 0: /* Child. */
descriptors();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86mxr7x0ih.fsf>
