Ack! One slipped through the cracks: remember to return the correctly

filled-in result structure to the caller when a resource allocation
error is encountered in ypbindproc_domain_2.
This commit is contained in:
Bill Paul 1995-05-11 00:16:54 +00:00
parent c9cd353a18
commit 4d6e34053f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8428

View File

@ -149,17 +149,17 @@ CLIENT *clnt;
break;
if(ypdb==NULL) {
if (domains > MAX_DOMAINS) {
if (domains == MAX_DOMAINS) {
syslog(LOG_WARNING, "domain limit (%d) exceeded",
MAX_DOMAINS);
res.ypbind_respbody.ypbind_error = YPBIND_ERR_RESC;
return;
return &res;
}
ypdb = (struct _dom_binding *)malloc(sizeof *ypdb);
if (ypdb == NULL) {
syslog(LOG_WARNING, "malloc: %s", strerror(errno));
res.ypbind_respbody.ypbind_error = YPBIND_ERR_RESC;
return;
return &res;
}
bzero((char *)ypdb, sizeof *ypdb);
strncpy(ypdb->dom_domain, argp, sizeof ypdb->dom_domain);