mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 00:10:15 +00:00
auth & [ak]log: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So, don't bother casting the return value before assigning it - it's unecessary noise. Change-Id: I270b81c239afb9ac4bd8121adfd5a48fcfac9c3b Reviewed-on: http://gerrit.openafs.org/7465 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
b0ccfea010
commit
56e350b855
@ -345,7 +345,7 @@ copy_cellinfo(cellinfo_t *cellinfo)
|
|||||||
{
|
{
|
||||||
cellinfo_t *new_cellinfo;
|
cellinfo_t *new_cellinfo;
|
||||||
|
|
||||||
if ((new_cellinfo = (cellinfo_t *)malloc(sizeof(cellinfo_t))))
|
if ((new_cellinfo = malloc(sizeof(cellinfo_t))))
|
||||||
memcpy(new_cellinfo, cellinfo, sizeof(cellinfo_t));
|
memcpy(new_cellinfo, cellinfo, sizeof(cellinfo_t));
|
||||||
|
|
||||||
return ((char *)new_cellinfo);
|
return ((char *)new_cellinfo);
|
||||||
|
@ -1820,7 +1820,7 @@ extern char **environ;
|
|||||||
|
|
||||||
for (senv = environ, numenv = 0; *senv; senv++)
|
for (senv = environ, numenv = 0; *senv; senv++)
|
||||||
numenv++;
|
numenv++;
|
||||||
newenv = (char **)malloc((numenv + 2) * sizeof(char *));
|
newenv = malloc((numenv + 2) * sizeof(char *));
|
||||||
|
|
||||||
for (senv = environ, denv = newenv; *senv; senv++) {
|
for (senv = environ, denv = newenv; *senv; senv++) {
|
||||||
if (strncmp(*senv, "KRBTKFILE=", 10) != 0 &&
|
if (strncmp(*senv, "KRBTKFILE=", 10) != 0 &&
|
||||||
|
@ -64,7 +64,7 @@ char rpcErr[256];
|
|||||||
void __RPC_FAR *__RPC_USER
|
void __RPC_FAR *__RPC_USER
|
||||||
midl_user_allocate(size_t cBytes)
|
midl_user_allocate(size_t cBytes)
|
||||||
{
|
{
|
||||||
return ((void __RPC_FAR *)malloc(cBytes));
|
return malloc(cBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __RPC_USER
|
void __RPC_USER
|
||||||
|
@ -143,8 +143,7 @@ unlog_ForgetCertainTokens(char **list, int listSize)
|
|||||||
code = ktc_ListTokens(count, &count, &serviceName);
|
code = ktc_ListTokens(count, &count, &serviceName);
|
||||||
} while (!code);
|
} while (!code);
|
||||||
|
|
||||||
tokenInfoP =
|
tokenInfoP = malloc((sizeof(struct tokenInfo) * count));
|
||||||
(struct tokenInfo *)malloc((sizeof(struct tokenInfo) * count));
|
|
||||||
if (!tokenInfoP) {
|
if (!tokenInfoP) {
|
||||||
perror("unlog_ForgetCertainTokens -- osi_Alloc failed");
|
perror("unlog_ForgetCertainTokens -- osi_Alloc failed");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -166,7 +166,7 @@ aklog_authenticate(char *userName, char *response, int *reenter, char **message)
|
|||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
char *str = afs_error_message(status);
|
char *str = afs_error_message(status);
|
||||||
*message = (char *)malloc(1024);
|
*message = malloc(1024);
|
||||||
#ifdef HAVE_KRB5_SVC_GET_MSG
|
#ifdef HAVE_KRB5_SVC_GET_MSG
|
||||||
if (strncmp(str, "unknown", strlen("unknown")) == 0) {
|
if (strncmp(str, "unknown", strlen("unknown")) == 0) {
|
||||||
krb5_svc_get_msg(status,&str);
|
krb5_svc_get_msg(status,&str);
|
||||||
|
@ -46,7 +46,7 @@ afs_authenticate(char *userName, char *response, int *reenter, char **message)
|
|||||||
if (strlen(pword) == 0) {
|
if (strlen(pword) == 0) {
|
||||||
printf
|
printf
|
||||||
("Unable to read password because zero length passord is illegal\n");
|
("Unable to read password because zero length passord is illegal\n");
|
||||||
*message = (char *)malloc(256);
|
*message = malloc(256);
|
||||||
sprintf(*message,
|
sprintf(*message,
|
||||||
"Unable to read password because zero length passord is illegal\n");
|
"Unable to read password because zero length passord is illegal\n");
|
||||||
return AUTH_FAILURE;
|
return AUTH_FAILURE;
|
||||||
@ -54,7 +54,7 @@ afs_authenticate(char *userName, char *response, int *reenter, char **message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((pwd = getpwnam(userName)) == NULL) {
|
if ((pwd = getpwnam(userName)) == NULL) {
|
||||||
*message = (char *)malloc(256);
|
*message = malloc(256);
|
||||||
sprintf(*message, "getpwnam for user failed\n");
|
sprintf(*message, "getpwnam for user failed\n");
|
||||||
return AUTH_FAILURE;
|
return AUTH_FAILURE;
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ afs_authenticate(char *userName, char *response, int *reenter, char **message)
|
|||||||
&password_expires, 0, &reason)) {
|
&password_expires, 0, &reason)) {
|
||||||
if (code == KANOENT)
|
if (code == KANOENT)
|
||||||
return AUTH_NOTFOUND;
|
return AUTH_NOTFOUND;
|
||||||
*message = (char *)malloc(1024);
|
*message = malloc(1024);
|
||||||
sprintf(*message, "Unable to authenticate to AFS because %s.\n",
|
sprintf(*message, "Unable to authenticate to AFS because %s.\n",
|
||||||
reason);
|
reason);
|
||||||
return AUTH_FAILURE;
|
return AUTH_FAILURE;
|
||||||
|
Loading…
Reference in New Issue
Block a user