Date: Mon, 18 Oct 2010 13:59:17 -0700 From: mdf@FreeBSD.org To: freebsd-current@freebsd.org Subject: uma_zfree(NULL) is broken Message-ID: <AANLkTim=vYZR3SQ-AcOHtBn%2BeUendBexc1Xst0hEsfCV@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
There's explicit protection for free(NULL, M_FOO), but uma_zfree(zone, NULL) will put NULL in the local bucket and then probably return it later from a uma_zalloc call. Obviously it's not a good idea to call uma_zfree(9) on NULL, but in this case it's an easy mistake to make when e.g. converting a set of malloc(9)/free(9) uses into uma(9). So is the "right" thing to allow a uma_zfree(NULL) and silently succeed, like for free(9)? That would be my guess, but I'm open to alternatives. Thanks, matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTim=vYZR3SQ-AcOHtBn%2BeUendBexc1Xst0hEsfCV>