Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 2002 12:53:08 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        jake@locore.ca
Cc:        ben@stuyts.nl, tlambert2@mindspring.com, current@FreeBSD.ORG, jroberson@chesapeake.net, rwatson@FreeBSD.ORG, jeff@FreeBSD.ORG, alfred@FreeBSD.ORG
Subject:   Re: [Ugly PATCH] Again: panic kmem_malloc()
Message-ID:  <20021020.125308.35255652.imp@bsdimp.com>
In-Reply-To: <20021018213608.A60569@locore.ca>
References:  <3DB07805.AB4BAA15@mindspring.com> <4.3.2.7.2.20021019001010.00b89f28@terminus> <20021018213608.A60569@locore.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20021018213608.A60569@locore.ca>
            Jake Burkholder <jake@locore.ca> writes:
: semop() leaks memory.  An important free() was removed by alfred in
: rev 1.55.  Try this.
: 
: Jake
: 
: Index: sysv_sem.c
: ===================================================================
: RCS file: /home/ncvs/src/sys/kern/sysv_sem.c,v
: retrieving revision 1.55
: diff -u -r1.55 sysv_sem.c
: --- sysv_sem.c	13 Aug 2002 08:47:17 -0000	1.55
: +++ sysv_sem.c	19 Oct 2002 01:20:35 -0000
: @@ -1128,6 +1128,8 @@
:  	td->td_retval[0] = 0;
:  done2:
:  	mtx_unlock(sema_mtxp);
: +	if (sops)
: +		free(sops, M_SEM);
:  	return (error);
:  }

The kernel free() groks free(NULL, M_FOO), so the if isn't needed.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021020.125308.35255652.imp>