Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2015 21:54:34 +0000 (UTC)
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282249 - head/sys/kern
Message-ID:  <201504292154.t3TLsYpQ060553@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: oshogbo
Date: Wed Apr 29 21:54:34 2015
New Revision: 282249
URL: https://svnweb.freebsd.org/changeset/base/282249

Log:
  Always use the nv_malloc macro instead of malloc(3).
  
  Approved by:	pjd (mentor)

Modified:
  head/sys/kern/subr_nvlist.c

Modified: head/sys/kern/subr_nvlist.c
==============================================================================
--- head/sys/kern/subr_nvlist.c	Wed Apr 29 21:50:04 2015	(r282248)
+++ head/sys/kern/subr_nvlist.c	Wed Apr 29 21:54:34 2015	(r282249)
@@ -963,7 +963,7 @@ nvlist_recv(int sock)
 	nfds = (size_t)nvlhdr.nvlh_descriptors;
 	size = sizeof(nvlhdr) + (size_t)nvlhdr.nvlh_size;
 
-	buf = malloc(size);
+	buf = nv_malloc(size);
 	if (buf == NULL)
 		return (NULL);
 
@@ -976,7 +976,7 @@ nvlist_recv(int sock)
 		goto out;
 
 	if (nfds > 0) {
-		fds = malloc(nfds * sizeof(fds[0]));
+		fds = nv_malloc(nfds * sizeof(fds[0]));
 		if (fds == NULL)
 			goto out;
 		if (fd_recv(sock, fds, nfds) == -1)



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