after discussions with beck deraadt kettenis.
-/* $OpenBSD: compat_dir.c,v 1.8 2014/01/15 05:31:51 deraadt Exp $ */
+/* $OpenBSD: compat_dir.c,v 1.9 2014/07/12 18:50:00 tedu Exp $ */
/*
* Copyright (c) 2000 Constantine Sapuntzakis
buf = malloc(buflen, M_TEMP, M_WAITOK);
error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curproc);
if (error) {
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
return (error);
}
eof:
out:
VOP_UNLOCK(vp, 0, curproc);
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
return (error);
}
-/* $OpenBSD: compat_util.c,v 1.12 2014/03/26 05:23:42 guenther Exp $ */
+/* $OpenBSD: compat_util.c,v 1.13 2014/07/12 18:50:00 tedu Exp $ */
/* $NetBSD: compat_util.c,v 1.4 1996/03/14 19:31:45 christos Exp $ */
/*
*pbuf = path;
goto bad;
}
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
}
vrele(nd.ni_vp);
bad2:
vrele(nd.ni_vp);
bad:
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
return error;
}
-/* $OpenBSD: linux_exec.c,v 1.41 2014/03/26 05:23:42 guenther Exp $ */
+/* $OpenBSD: linux_exec.c,v 1.42 2014/07/12 18:50:00 tedu Exp $ */
/* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */
/*-
}
/* free Linux emuldata and set the pointer to null */
- free(p->p_emuldata, M_EMULDATA);
+ free(p->p_emuldata, M_EMULDATA, 0);
p->p_emuldata = NULL;
}
if ((error = emul_find(p, NULL, linux_emul_path, itp, &bp, 0)))
return (error);
error = copystr(bp, itp, MAXPATHLEN, &len);
- free(bp, M_TEMP);
+ free(bp, M_TEMP, 0);
if (error)
return (error);
}
-/* $OpenBSD: linux_socket.c,v 1.52 2014/04/07 10:04:17 mpi Exp $ */
+/* $OpenBSD: linux_socket.c,v 1.53 2014/07/12 18:50:00 tedu Exp $ */
/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */
/*
out:
*osalen = alloclen;
- free(kosa, M_TEMP);
+ free(kosa, M_TEMP, 0);
return (error);
}
-/* $OpenBSD: crypto.c,v 1.63 2014/01/21 05:40:32 mikeb Exp $ */
+/* $OpenBSD: crypto.c,v 1.64 2014/07/12 18:50:00 tedu Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
newdrv[i].cc_flags = flags;
crypto_drivers_num *= 2;
- free(crypto_drivers, M_CRYPTO_DATA);
+ free(crypto_drivers, M_CRYPTO_DATA, 0);
crypto_drivers = newdrv;
splx(s);
return i;
-/* $OpenBSD: cryptodev.c,v 1.80 2012/10/28 21:26:11 mikeb Exp $ */
+/* $OpenBSD: cryptodev.c,v 1.81 2014/07/12 18:50:00 tedu Exp $ */
/*
* Copyright (c) 2001 Theo de Raadt
if (error) {
if (crie.cri_key) {
explicit_bzero(crie.cri_key, crie.cri_klen / 8);
- free(crie.cri_key, M_XDATA);
+ free(crie.cri_key, M_XDATA, 0);
}
if (cria.cri_key) {
explicit_bzero(cria.cri_key, cria.cri_klen / 8);
- free(cria.cri_key, M_XDATA);
+ free(cria.cri_key, M_XDATA, 0);
}
}
break;
if (krp->krp_param[i].crp_p) {
explicit_bzero(krp->krp_param[i].crp_p,
(krp->krp_param[i].crp_nbits + 7) / 8);
- free(krp->krp_param[i].crp_p, M_XDATA);
+ free(krp->krp_param[i].crp_p, M_XDATA, 0);
}
}
- free(krp, M_XDATA);
+ free(krp, M_XDATA, 0);
}
return (error);
}
TAILQ_REMOVE(&fcr->csessions, cse, next);
(void)csefree(cse);
}
- free(fcr, M_XDATA);
+ free(fcr, M_XDATA, 0);
fp->f_data = NULL;
return 0;
}
error = falloc(p, &f, &fd);
fdpunlock(p->p_fd);
if (error) {
- free(fcr, M_XDATA);
+ free(fcr, M_XDATA, 0);
return (error);
}
f->f_flag = FREAD | FWRITE;
error = crypto_freesession(cse->sid);
if (cse->key)
- free(cse->key, M_XDATA);
+ free(cse->key, M_XDATA, 0);
if (cse->mackey)
- free(cse->mackey, M_XDATA);
- free(cse, M_XDATA);
+ free(cse->mackey, M_XDATA, 0);
+ free(cse, M_XDATA, 0);
return (error);
}
-/* $OpenBSD: cryptosoft.c,v 1.69 2013/08/25 14:26:56 jsing Exp $ */
+/* $OpenBSD: cryptosoft.c,v 1.70 2014/07/12 18:50:00 tedu Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
else
result = cxf->decompress(data, crd->crd_len, &out);
- free(data, M_CRYPTO_DATA);
+ free(data, M_CRYPTO_DATA, 0);
if (result == 0)
return EINVAL;
if (crd->crd_flags & CRD_F_COMP) {
if (result > crd->crd_len) {
/* Compression was useless, we lost time */
- free(out, M_CRYPTO_DATA);
+ free(out, M_CRYPTO_DATA, 0);
return 0;
}
}
}
}
}
- free(out, M_CRYPTO_DATA);
+ free(out, M_CRYPTO_DATA, 0);
return 0;
}
if (swcr_sessions) {
bcopy(swcr_sessions, swd,
(swcr_sesnum / 2) * sizeof(struct swcr_data *));
- free(swcr_sessions, M_CRYPTO_DATA);
+ free(swcr_sessions, M_CRYPTO_DATA, 0);
}
swcr_sessions = swd;
if (swd->sw_kschedule) {
explicit_bzero(swd->sw_kschedule, txf->ctxsize);
- free(swd->sw_kschedule, M_CRYPTO_DATA);
+ free(swd->sw_kschedule, M_CRYPTO_DATA, 0);
}
break;
if (swd->sw_ictx) {
explicit_bzero(swd->sw_ictx, axf->ctxsize);
- free(swd->sw_ictx, M_CRYPTO_DATA);
+ free(swd->sw_ictx, M_CRYPTO_DATA, 0);
}
if (swd->sw_octx) {
explicit_bzero(swd->sw_octx, axf->ctxsize);
- free(swd->sw_octx, M_CRYPTO_DATA);
+ free(swd->sw_octx, M_CRYPTO_DATA, 0);
}
break;
if (swd->sw_ictx) {
explicit_bzero(swd->sw_ictx, axf->ctxsize);
- free(swd->sw_ictx, M_CRYPTO_DATA);
+ free(swd->sw_ictx, M_CRYPTO_DATA, 0);
}
if (swd->sw_octx) {
explicit_bzero(swd->sw_octx, swd->sw_klen);
- free(swd->sw_octx, M_CRYPTO_DATA);
+ free(swd->sw_octx, M_CRYPTO_DATA, 0);
}
break;
if (swd->sw_ictx) {
explicit_bzero(swd->sw_ictx, axf->ctxsize);
- free(swd->sw_ictx, M_CRYPTO_DATA);
+ free(swd->sw_ictx, M_CRYPTO_DATA, 0);
}
break;
}
- free(swd, M_CRYPTO_DATA);
+ free(swd, M_CRYPTO_DATA, 0);
}
return 0;
}
-/* $OpenBSD: xform_ipcomp.c,v 1.3 2014/02/18 09:43:34 markus Exp $ */
+/* $OpenBSD: xform_ipcomp.c,v 1.4 2014/07/12 18:50:00 tedu Exp $ */
/*
* Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
if (count > buf[j].size) {
bcopy(buf[j].out, *out, buf[j].size);
*out += buf[j].size;
- free(buf[j].out, M_CRYPTO_DATA);
+ free(buf[j].out, M_CRYPTO_DATA, 0);
count -= buf[j].size;
} else {
/* it should be the last buffer */
bcopy(buf[j].out, *out, count);
*out += count;
- free(buf[j].out, M_CRYPTO_DATA);
+ free(buf[j].out, M_CRYPTO_DATA, 0);
count = 0;
}
}
bad:
*out = NULL;
for (j = 0; buf[j].flag != 0; j++)
- free(buf[j].out, M_CRYPTO_DATA);
+ free(buf[j].out, M_CRYPTO_DATA, 0);
if (decomp)
inflateEnd(&zbuf);
else
-/* $OpenBSD: cd9660_lookup.c,v 1.20 2013/06/11 16:42:15 deraadt Exp $ */
+/* $OpenBSD: cd9660_lookup.c,v 1.21 2014/07/12 18:50:00 tedu Exp $ */
/* $NetBSD: cd9660_lookup.c,v 1.18 1997/05/08 16:19:59 mycroft Exp $ */
/*-
cd9660_rrip_getname(ep,altname,&namelen,&dp->i_ino,imp);
if (namelen == cnp->cn_namelen
&& !bcmp(name,altname,namelen)) {
- free(altname, M_TEMP);
+ free(altname, M_TEMP, 0);
goto found;
}
- free(altname, M_TEMP);
+ free(altname, M_TEMP, 0);
ino = 0;
break;
}
-/* $OpenBSD: cd9660_node.c,v 1.23 2013/06/02 01:07:39 deraadt Exp $ */
+/* $OpenBSD: cd9660_node.c,v 1.24 2014/07/12 18:50:00 tedu Exp $ */
/* $NetBSD: cd9660_node.c,v 1.17 1997/05/05 07:13:57 mycroft Exp $ */
/*-
vrele(ip->i_devvp);
ip->i_devvp = 0;
}
- free(vp->v_data, M_ISOFSNODE);
+ free(vp->v_data, M_ISOFSNODE, 0);
vp->v_data = NULL;
return (0);
}
-/* $OpenBSD: cd9660_vfsops.c,v 1.67 2014/05/09 03:54:28 tedu Exp $ */
+/* $OpenBSD: cd9660_vfsops.c,v 1.68 2014/07/12 18:50:00 tedu Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */
/*-
if ((error = iso_mountfs(rootvp, mp, p, &args)) != 0) {
mp->mnt_vfc->vfc_refcount--;
vfs_unbusy(mp);
- free(mp, M_MOUNT);
+ free(mp, M_MOUNT, 0);
return (error);
}
VOP_UNLOCK(devvp, 0, p);
if (isomp) {
- free((caddr_t)isomp, M_ISOFSMNT);
+ free((caddr_t)isomp, M_ISOFSMNT, 0);
mp->mnt_data = (qaddr_t)0;
}
return (error);
vn_lock(isomp->im_devvp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
vput(isomp->im_devvp);
- free((caddr_t)isomp, M_ISOFSMNT);
+ free((caddr_t)isomp, M_ISOFSMNT, 0);
mp->mnt_data = (qaddr_t)0;
mp->mnt_flag &= ~MNT_LOCAL;
return (error);
-/* $OpenBSD: cd9660_vnops.c,v 1.65 2014/05/09 03:54:28 tedu Exp $ */
+/* $OpenBSD: cd9660_vnops.c,v 1.66 2014/07/12 18:50:00 tedu Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
rdlnk.a_cred = ap->a_cred;
if (cd9660_readlink(&rdlnk) == 0)
vap->va_size = MAXPATHLEN - auio.uio_resid;
- free(cp, M_TEMP);
+ free(cp, M_TEMP, 0);
}
vap->va_flags = 0;
vap->va_gen = 1;
}
error = breadn(vp, lbn, size, ra->blks,
ra->sizes, i, &bp);
- free(ra, M_TEMP);
+ free(ra, M_TEMP, 0);
} else
error = bread(vp, lbn, size, &bp);
ci->ci_lastr = lbn;
if ((entryoffsetinblock = idp->curroff & bmask) &&
(error = cd9660_bufatoff(dp, (off_t)idp->curroff, NULL, &bp))) {
- free(idp, M_TEMP);
+ free(idp, M_TEMP, 0);
return (error);
}
endsearch = dp->i_size;
uio->uio_offset = idp->uio_off;
*ap->a_eofflag = idp->eofflag;
- free(idp, M_TEMP);
+ free(idp, M_TEMP, 0);
return (error);
}
-/* $OpenBSD: udf_vfsops.c,v 1.41 2013/05/30 17:35:01 guenther Exp $ */
+/* $OpenBSD: udf_vfsops.c,v 1.42 2014/07/12 18:50:00 tedu Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
bail:
if (ump->um_hashtbl != NULL)
- free(ump->um_hashtbl, M_UDFMOUNT);
+ free(ump->um_hashtbl, M_UDFMOUNT, 0);
if (ump != NULL) {
- free(ump, M_UDFMOUNT);
+ free(ump, M_UDFMOUNT, 0);
mp->mnt_data = NULL;
mp->mnt_flag &= ~MNT_LOCAL;
}
vrele(devvp);
if (ump->um_flags & UDF_MNT_USES_VAT)
- free(ump->um_vat, M_UDFMOUNT);
+ free(ump->um_vat, M_UDFMOUNT, 0);
if (ump->um_stbl != NULL)
- free(ump->um_stbl, M_UDFMOUNT);
+ free(ump->um_stbl, M_UDFMOUNT, 0);
if (ump->um_hashtbl != NULL)
- free(ump->um_hashtbl, M_UDFMOUNT);
+ free(ump->um_hashtbl, M_UDFMOUNT, 0);
- free(ump, M_UDFMOUNT);
+ free(ump, M_UDFMOUNT, 0);
mp->mnt_data = (qaddr_t)0;
mp->mnt_flag &= ~MNT_LOCAL;
bp = NULL;
if ((error = udf_allocv(mp, &vp, p))) {
- free(up->u_fentry, M_UDFFENTRY);
+ free(up->u_fentry, M_UDFFENTRY, 0);
pool_put(&unode_pool, up);
return (error); /* Error from udf_allocv() */
}
if (error) {
if (bp != NULL)
brelse(bp);
- free(ump->um_stbl, M_UDFMOUNT);
+ free(ump->um_stbl, M_UDFMOUNT, 0);
return (error); /* Failed to read sparing table */
}
bp = NULL;
if (udf_checktag(&ump->um_stbl->tag, 0)) {
- free(ump->um_stbl, M_UDFMOUNT);
+ free(ump->um_stbl, M_UDFMOUNT, 0);
return (EINVAL); /* Invalid sparing table found */
}
-/* $OpenBSD: udf_vnops.c,v 1.54 2013/12/14 02:57:25 guenther Exp $ */
+/* $OpenBSD: udf_vnops.c,v 1.55 2014/07/12 18:50:00 tedu Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
*/
if (ds->fid_fragment && ds->buf != NULL) {
ds->fid_fragment = 0;
- free(ds->buf, M_UDFFID);
+ free(ds->buf, M_UDFFID, 0);
}
fid = (struct fileid_desc*)&ds->data[ds->off];
}
if (ds->fid_fragment && ds->buf != NULL)
- free(ds->buf, M_UDFFID);
+ free(ds->buf, M_UDFFID, 0);
pool_put(&udf_ds_pool, ds);
}
}
if (up->u_fentry != NULL)
- free(up->u_fentry, M_UDFFENTRY);
+ free(up->u_fentry, M_UDFFENTRY, 0);
pool_put(&unode_pool, up);
vp->v_data = NULL;