summaryrefslogtreecommitdiffstats
path: root/usr.sbin/netgroup_mkdb
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2007-03-05 20:29:14 +0000
committermillert <millert@openbsd.org>2007-03-05 20:29:14 +0000
commit7e91b1a94f9a341a4b7e194057b262f908678d9e (patch)
treed01b2946a36232f8a3571b7a321e2bb84b23d8be /usr.sbin/netgroup_mkdb
parentSet pointer to NULL after freeing it, so callers of (diff)
downloadwireguard-openbsd-7e91b1a94f9a341a4b7e194057b262f908678d9e.tar.xz
wireguard-openbsd-7e91b1a94f9a341a4b7e194057b262f908678d9e.zip
Remove _err() calls from getnetgrent.c. This is a minor API change
as _ng_sl_add() now returns a value. The only consumer of that interface is netgroup_mkdb(8). Adapted from NetBSD. OK deraadt@
Diffstat (limited to 'usr.sbin/netgroup_mkdb')
-rw-r--r--usr.sbin/netgroup_mkdb/netgroup_mkdb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/netgroup_mkdb/netgroup_mkdb.c b/usr.sbin/netgroup_mkdb/netgroup_mkdb.c
index fdb90187fab..ffea15e8703 100644
--- a/usr.sbin/netgroup_mkdb/netgroup_mkdb.c
+++ b/usr.sbin/netgroup_mkdb/netgroup_mkdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netgroup_mkdb.c,v 1.12 2005/05/16 03:12:59 deraadt Exp $ */
+/* $OpenBSD: netgroup_mkdb.c,v 1.13 2007/03/05 20:29:14 millert Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
#ifndef lint
-static char *rcsid = "$OpenBSD: netgroup_mkdb.c,v 1.12 2005/05/16 03:12:59 deraadt Exp $";
+static char *rcsid = "$OpenBSD: netgroup_mkdb.c,v 1.13 2007/03/05 20:29:14 millert Exp $";
#endif
#include <sys/types.h>
@@ -363,7 +363,10 @@ ng_reventry(DB *db, DB *udb, struct nentry *fe, char *name, size_t s,
warnx("Cycle in netgroup `%s'", name);
return;
}
- _ng_sl_add(ss, fe->n_name);
+ if (_ng_sl_add(ss, fe->n_name) == -1) {
+ warn(NULL);
+ return;
+ }
for (e = fe->n_next; e != NULL; e = e->n_next)
switch (e->n_type) {