diff options
-rw-r--r-- | src/sm_manager.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sm_manager.c b/src/sm_manager.c index f2b4cd1..c75764f 100644 --- a/src/sm_manager.c +++ b/src/sm_manager.c @@ -76,7 +76,10 @@ _SmsProtocolSetupProc (IceConn iceConn, if ((smsConn = (SmsConn) malloc (sizeof (struct _SmsConn))) == NULL) { - *failureReasonRet = strdup ("Memory allocation failed"); + char *str = "Memory allocation failed"; + + if ((*failureReasonRet = (char *) malloc (strlen (str) + 1)) != NULL) + strcpy (*failureReasonRet, str); return (0); } |