Don't leak handle if svc_tp_create(..) succeeds and allocating a new

struct xlist object fails

MFC after: 1 week
Reported by: Coverity
CID: 978277
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-05-22 02:02:18 +00:00
parent 9c11e6b093
commit 3552a02626
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=300386

View File

@ -122,7 +122,8 @@ svc_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
if (l == NULL) {
warnx("svc_create: no memory");
mutex_unlock(&xprtlist_lock);
return (0);
num = 0;
goto done;
}
l->xprt = xprt;
l->next = xprtlist;
@ -132,6 +133,7 @@ svc_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
}
mutex_unlock(&xprtlist_lock);
}
done:
__rpc_endconf(handle);
/*
* In case of num == 0; the error messages are generated by the