Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Aug 2019 07:52:06 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351385 - head/usr.bin/w
Message-ID:  <201908220752.x7M7q6Mq048117@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Thu Aug 22 07:52:06 2019
New Revision: 351385
URL: https://svnweb.freebsd.org/changeset/base/351385

Log:
  w: initialize save_p to silence 'may be used uninitilized'
  
  After r351379 save_p may be used uninitialized.  Set it to NULL before
  first assignment so that a later NULL check will work correctly.
  
  Reported by:		CI system for gcc platforms
  MFC after:		1 week
  X-MFC with:		351379 (karels)

Modified:
  head/usr.bin/w/w.c

Modified: head/usr.bin/w/w.c
==============================================================================
--- head/usr.bin/w/w.c	Thu Aug 22 07:37:34 2019	(r351384)
+++ head/usr.bin/w/w.c	Thu Aug 22 07:52:06 2019	(r351385)
@@ -209,6 +209,7 @@ main(int argc, char *argv[])
 	if (*argv)
 		sel_users = argv;
 
+	save_p = NULL;
 	setutxent();
 	for (nusers = 0; (utmp = getutxent()) != NULL;) {
 		struct addrinfo hints, *res;



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