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:
Simon Wilkinson 2012-05-17 12:29:51 +01:00 committed by Derrick Brashear
parent b0ccfea010
commit 56e350b855
6 changed files with 8 additions and 9 deletions

View File

@ -345,7 +345,7 @@ copy_cellinfo(cellinfo_t *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));
return ((char *)new_cellinfo);

View File

@ -1820,7 +1820,7 @@ extern char **environ;
for (senv = environ, numenv = 0; *senv; senv++)
numenv++;
newenv = (char **)malloc((numenv + 2) * sizeof(char *));
newenv = malloc((numenv + 2) * sizeof(char *));
for (senv = environ, denv = newenv; *senv; senv++) {
if (strncmp(*senv, "KRBTKFILE=", 10) != 0 &&

View File

@ -64,7 +64,7 @@ char rpcErr[256];
void __RPC_FAR *__RPC_USER
midl_user_allocate(size_t cBytes)
{
return ((void __RPC_FAR *)malloc(cBytes));
return malloc(cBytes);
}
void __RPC_USER

View File

@ -143,8 +143,7 @@ unlog_ForgetCertainTokens(char **list, int listSize)
code = ktc_ListTokens(count, &count, &serviceName);
} while (!code);
tokenInfoP =
(struct tokenInfo *)malloc((sizeof(struct tokenInfo) * count));
tokenInfoP = malloc((sizeof(struct tokenInfo) * count));
if (!tokenInfoP) {
perror("unlog_ForgetCertainTokens -- osi_Alloc failed");
exit(1);

View File

@ -166,7 +166,7 @@ aklog_authenticate(char *userName, char *response, int *reenter, char **message)
if (status) {
char *str = afs_error_message(status);
*message = (char *)malloc(1024);
*message = malloc(1024);
#ifdef HAVE_KRB5_SVC_GET_MSG
if (strncmp(str, "unknown", strlen("unknown")) == 0) {
krb5_svc_get_msg(status,&str);

View File

@ -46,7 +46,7 @@ afs_authenticate(char *userName, char *response, int *reenter, char **message)
if (strlen(pword) == 0) {
printf
("Unable to read password because zero length passord is illegal\n");
*message = (char *)malloc(256);
*message = malloc(256);
sprintf(*message,
"Unable to read password because zero length passord is illegal\n");
return AUTH_FAILURE;
@ -54,7 +54,7 @@ afs_authenticate(char *userName, char *response, int *reenter, char **message)
}
if ((pwd = getpwnam(userName)) == NULL) {
*message = (char *)malloc(256);
*message = malloc(256);
sprintf(*message, "getpwnam for user failed\n");
return AUTH_FAILURE;
}
@ -65,7 +65,7 @@ afs_authenticate(char *userName, char *response, int *reenter, char **message)
&password_expires, 0, &reason)) {
if (code == KANOENT)
return AUTH_NOTFOUND;
*message = (char *)malloc(1024);
*message = malloc(1024);
sprintf(*message, "Unable to authenticate to AFS because %s.\n",
reason);
return AUTH_FAILURE;