Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2019 06:33:05 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r346220 - head/sbin/fsck_msdosfs
Message-ID:  <201904150633.x3F6X5W7025546@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Apr 15 06:33:05 2019
New Revision: 346220
URL: https://svnweb.freebsd.org/changeset/base/346220

Log:
  Don't cast result from malloc().
  
  MFC after:	2 weeks

Modified:
  head/sbin/fsck_msdosfs/dir.c

Modified: head/sbin/fsck_msdosfs/dir.c
==============================================================================
--- head/sbin/fsck_msdosfs/dir.c	Mon Apr 15 03:32:01 2019	(r346219)
+++ head/sbin/fsck_msdosfs/dir.c	Mon Apr 15 06:33:05 2019	(r346220)
@@ -115,7 +115,7 @@ newDosDirEntry(void)
 	struct dosDirEntry *de;
 
 	if (!(de = freede)) {
-		if (!(de = (struct dosDirEntry *)malloc(sizeof *de)))
+		if (!(de = malloc(sizeof *de)))
 			return 0;
 	} else
 		freede = de->next;
@@ -140,7 +140,7 @@ newDirTodo(void)
 	struct dirTodoNode *dt;
 
 	if (!(dt = freedt)) {
-		if (!(dt = (struct dirTodoNode *)malloc(sizeof *dt)))
+		if (!(dt = malloc(sizeof *dt)))
 			return 0;
 	} else
 		freedt = dt->next;



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