summaryrefslogtreecommitdiff
path: root/src/sm_manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sm_manager.c')
-rw-r--r--src/sm_manager.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/sm_manager.c b/src/sm_manager.c
index 14b2bea..9e0d187 100644
--- a/src/sm_manager.c
+++ b/src/sm_manager.c
@@ -72,8 +72,7 @@ _SmsProtocolSetupProc (IceConn iceConn,
{
const char *str = "Memory allocation failed";
- if ((*failureReasonRet = (char *) malloc (strlen (str) + 1)) != NULL)
- strcpy (*failureReasonRet, str);
+ *failureReasonRet = strdup (str);
return (0);
}
@@ -187,13 +186,11 @@ SmsRegisterClientReply(SmsConn smsConn, char *clientId)
smRegisterClientReplyMsg *pMsg;
char *pData;
- if ((smsConn->client_id = (char *) malloc (strlen (clientId) + 1)) == NULL)
+ if ((smsConn->client_id = strdup (clientId)) == NULL)
{
return (0);
}
- strcpy (smsConn->client_id, clientId);
-
extra = ARRAY8_BYTES (strlen (clientId));
IceGetHeaderExtra (iceConn, _SmsOpcode, SM_RegisterClientReply,