Module Name:    src
Committed By:   mrg
Date:           Tue Apr 13 03:09:42 UTC 2021

Modified Files:
        src/usr.bin/config: sem.c

Log Message:
ensure that pointer is filled in when used upon return.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/config/sem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.84 src/usr.bin/config/sem.c:1.85
--- src/usr.bin/config/sem.c:1.84	Sat Mar  7 19:26:13 2020
+++ src/usr.bin/config/sem.c	Tue Apr 13 03:09:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.84 2020/03/07 19:26:13 christos Exp $	*/
+/*	$NetBSD: sem.c,v 1.85 2021/04/13 03:09:42 mrg Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: sem.c,v 1.84 2020/03/07 19:26:13 christos Exp $");
+__RCSID("$NetBSD: sem.c,v 1.85 2021/04/13 03:09:42 mrg Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -828,10 +828,10 @@ getrefattr(const char *name, struct attr
 	/*
 	 * Check if the existing attr is only referenced, not really defined.
 	 */
+	*ra = a;
 	if (a->a_deps == NULL &&
 	    a->a_iattr == 0 &&
 	    a->a_devclass == 0) {
-		*ra = a;
 		return (0);
 	}
 	return (1);

Reply via email to