Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2015 11:24:35 +0000 (UTC)
From:      Ulrich Spoerlein <uqs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r292863 - in head/sbin: mount umount
Message-ID:  <201512291124.tBTBOZRW000714@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: uqs
Date: Tue Dec 29 11:24:35 2015
New Revision: 292863
URL: https://svnweb.freebsd.org/changeset/base/292863

Log:
  Fix type mismatches for malloc(3) and Co.
  
  Found by:	clang static analyzer
  Reviewed by:	ed
  Differential Revision:	https://reviews.freebsd.org/D4722

Modified:
  head/sbin/mount/mount.c
  head/sbin/umount/umount.c

Modified: head/sbin/mount/mount.c
==============================================================================
--- head/sbin/mount/mount.c	Tue Dec 29 08:39:07 2015	(r292862)
+++ head/sbin/mount/mount.c	Tue Dec 29 11:24:35 2015	(r292863)
@@ -541,7 +541,7 @@ append_arg(struct cpa *sa, char *arg)
 {
 	if (sa->c + 1 == sa->sz) {
 		sa->sz = sa->sz == 0 ? 8 : sa->sz * 2;
-		sa->a = realloc(sa->a, sizeof(sa->a) * sa->sz);
+		sa->a = realloc(sa->a, sizeof(*sa->a) * sa->sz);
 		if (sa->a == NULL)
 			errx(1, "realloc failed");
 	}

Modified: head/sbin/umount/umount.c
==============================================================================
--- head/sbin/umount/umount.c	Tue Dec 29 08:39:07 2015	(r292862)
+++ head/sbin/umount/umount.c	Tue Dec 29 11:24:35 2015	(r292863)
@@ -434,7 +434,7 @@ getmntentry(const char *fromname, const 
 {
 	static struct statfs *mntbuf;
 	static size_t mntsize = 0;
-	static char *mntcheck = NULL;
+	static int *mntcheck = NULL;
 	struct statfs *sfs, *foundsfs;
 	int i, count;
 



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