svn commit: r351385 - head/usr.bin/w

Bjoern A. Zeeb bz at FreeBSD.org
Thu Aug 22 07:52:06 UTC 2019


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;


More information about the svn-src-head mailing list