mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-05 01:30:43 +00:00
Avoid possible null deref if ypclnt_new returns null
PR: bin/172979 Submitted by: Erik Cederstrand <erik@cederstrand.dk> Approved by: cperciva MFC after: 3 days
This commit is contained in:
parent
413379c5a8
commit
23382e4b50
@ -241,8 +241,11 @@ main(int argc, char *argv[])
|
||||
#ifdef YP
|
||||
case _PWF_NIS:
|
||||
ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host);
|
||||
if (ypclnt == NULL ||
|
||||
ypclnt_connect(ypclnt) == -1 ||
|
||||
if (ypclnt == NULL) {
|
||||
warnx("ypclnt_new failed");
|
||||
exit(1);
|
||||
}
|
||||
if (ypclnt_connect(ypclnt) == -1 ||
|
||||
ypclnt_passwd(ypclnt, pw, password) == -1) {
|
||||
warnx("%s", ypclnt->error);
|
||||
ypclnt_free(ypclnt);
|
||||
|
Loading…
Reference in New Issue
Block a user