xdr: Stop checking for failures from malloc(M_WAITOK)

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 7a720bf67d)
This commit is contained in:
Zhenlei Huang 2024-09-03 18:25:20 +08:00
parent ce70888084
commit 3d5e539b1f

View file

@ -95,10 +95,7 @@ x_inline(XDR *xdrs, u_int len)
/* Free the earlier space and allocate new area */
if (xdrs->x_private)
free(xdrs->x_private, M_RPC);
if ((xdrs->x_private = (caddr_t) malloc(len, M_RPC, M_WAITOK)) == NULL) {
xdrs->x_base = 0;
return (NULL);
}
xdrs->x_private = malloc(len, M_RPC, M_WAITOK);
xdrs->x_base = (caddr_t)(uintptr_t) len;
xdrs->x_handy += len;
return ((int32_t *) xdrs->x_private);