DEVEL15-pioctl-settoken-malloc-fail-check-20080206

LICENSE IPL10

avoid malloc failure panic (oops)


(cherry picked from commit f58e08baae0a5ee9be516e9e220a12b78e5bf414)
This commit is contained in:
Derrick Brashear 2008-03-06 16:44:10 +00:00
parent 82904b8ace
commit 87a3ff8b72

View File

@ -1409,6 +1409,9 @@ DECL_PIOCTL(PSetTokens)
afs_osi_Free(tu->stp, tu->stLen);
}
tu->stp = (char *)afs_osi_Alloc(stLen);
if (tu->stp == NULL) {
return ENOMEM;
}
tu->stLen = stLen;
memcpy(tu->stp, stp, stLen);
tu->ct = clear;