summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-11-08 15:47:43 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-11-08 15:59:28 -0800
commitf391fa1f55436ec2e4f7de4c4734fcd89cdbe250 (patch)
tree306687ec67d1c837418887fb32cc020f68cd82dc
parent5d5a7f80d905d58530c8473bc7ec0b0b3b165658 (diff)
Stop casting results of malloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--config.c6
-rw-r--r--main.c8
-rw-r--r--pmdb.c16
-rw-r--r--pmint.h2
4 files changed, 16 insertions, 16 deletions
diff --git a/config.c b/config.c
index 8696ac5..120e35a 100644
--- a/config.c
+++ b/config.c
@@ -49,9 +49,9 @@ FILE *f)
else
*plen = BUFSIZ;
if (*pbuf)
- *pbuf = (char *) realloc (*pbuf, *plen + 1);
+ *pbuf = realloc (*pbuf, *plen + 1);
else
- *pbuf = (char *) malloc (*plen + 1);
+ *pbuf = malloc (*plen + 1);
if (! *pbuf) {
fprintf (stderr, "Memory allocation failure reading config file\n");
return 0;
@@ -159,7 +159,7 @@ GetConfig (
if (*managed)
{
n = strlen (p) + 2;
- *startCommand = (char *) malloc (n);
+ *startCommand = malloc (n);
if (! *startCommand) {
fprintf (stderr,
"Memory allocation failed for service \"%s\"\n",
diff --git a/main.c b/main.c
index d4ffc78..f14fdc2 100644
--- a/main.c
+++ b/main.c
@@ -177,7 +177,7 @@ main (int argc, char *argv[])
}
networkIds = IceComposeNetworkIdList (numTransports, listenObjs);
- p = (char *) malloc(sizeof ("PROXY_MANAGER") + strlen(networkIds) + 2);
+ p = malloc (sizeof ("PROXY_MANAGER") + strlen(networkIds) + 2);
sprintf (p, "PROXY_MANAGER=%s", networkIds);
putenv (p);
printf ("%s\n", p);
@@ -275,7 +275,7 @@ PMprotocolSetupProc(IceConn iceConn, int majorVersion, int minorVersion,
static char standardError[] = "Could not allocate memory for new client";
PMconn *pmConn;
- if ((pmConn = (PMconn *) malloc (sizeof (PMconn))) == NULL)
+ if ((pmConn = malloc (sizeof (PMconn))) == NULL)
{
if (verbose)
fprintf (stderr, "%s\n", standardError);
@@ -449,7 +449,7 @@ PMReplyProcessMessages(IceConn iceConn, IcePointer clientData, int opcode,
if (authLen > 0)
{
EXTRACT_STRING (pData, swap, authName);
- authData = (char *) malloc (authLen);
+ authData = malloc (authLen);
memcpy (authData, pData, authLen);
}
@@ -513,7 +513,7 @@ PMReplyProcessMessages(IceConn iceConn, IcePointer clientData, int opcode,
char * pch = strdup (tmpName);
len = strlen(canonname) + strlen(tmpName) + 1;
- serverAddress = (char *) realloc (serverAddress, len);
+ serverAddress = realloc (serverAddress, len);
sprintf (serverAddress, "%s%s", canonname, pch);
free (pch);
}
diff --git a/pmdb.c b/pmdb.c
index a967367..9de3fb2 100644
--- a/pmdb.c
+++ b/pmdb.c
@@ -72,7 +72,7 @@ FindProxyService (
}
if (createIf) {
- service = (proxy_service *) malloc (sizeof (proxy_service));
+ service = malloc (sizeof (proxy_service));
if (!service)
return NULL;
@@ -115,7 +115,7 @@ StartNewProxy (
if (!service)
return NULL;
- proxy = (running_proxy *) malloc (sizeof (running_proxy));
+ proxy = malloc (sizeof (running_proxy));
if (!proxy)
return NULL;
@@ -210,7 +210,7 @@ ConnectToProxy (
SetCloseOnExec (IceConnectionNumber (proxy_iceConn));
/* See PMprotocolSetupProc */
- pmConn = (PMconn *) malloc (sizeof (PMconn));
+ pmConn = malloc (sizeof (PMconn));
if (pmConn == NULL) {
IceCloseConnection (proxy_iceConn);
@@ -239,7 +239,7 @@ ConnectToProxy (
pmConn->release = release;
}
- proxy = (running_proxy *) malloc (sizeof (running_proxy));
+ proxy = malloc (sizeof (running_proxy));
if (!proxy) {
IceCloseConnection (proxy_iceConn);
free (pmConn);
@@ -473,7 +473,7 @@ GetRunningProxyList (
if (!service || !service->proxyCount)
return NULL;
- runList = (running_proxy_list *) malloc (sizeof (running_proxy_list) +
+ runList = malloc (sizeof (running_proxy_list) +
service->proxyCount * sizeof (running_proxy *));
if (!runList)
@@ -555,7 +555,7 @@ PushRequestorQueue (
char *authData)
{
- request_list *newreq = (request_list *) malloc (sizeof (request_list));
+ request_list *newreq = malloc (sizeof (request_list));
if (!newreq)
return 0;
@@ -567,7 +567,7 @@ PushRequestorQueue (
if (authLen > 0)
{
newreq->authName = strdup (authName);
- newreq->authData = (char *) malloc (authLen);
+ newreq->authData = malloc (authLen);
}
else
newreq->authName = newreq->authData = NULL;
@@ -720,7 +720,7 @@ PopRequestorQueue (
if (newServer)
{
- server = (server_list *) malloc (sizeof (server_list));
+ server = malloc (sizeof (server_list));
server->serverAddress = proxy->requests->serverAddress;
server->next = proxy->servers;
proxy->servers = server;
diff --git a/pmint.h b/pmint.h
index 9254824..0e8063f 100644
--- a/pmint.h
+++ b/pmint.h
@@ -147,7 +147,7 @@ extern void _XtProcessIceMsgProc ( XtPointer client_data, int *source, XtInputId
{ \
CARD16 _len; \
EXTRACT_CARD16 (_pBuf, _swap, _len); \
- _string = (char *) malloc (_len + 1); \
+ _string = malloc (_len + 1); \
memcpy (_string, _pBuf, _len); \
_string[_len] = '\0'; \
_pBuf += _len; \