From 9bfa1101ac5dbb8d2de1d0431d7e7b281428168f Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 13 May 2007 11:46:16 +0200 Subject: Revert "Don't reinvent the wheel and just use strdup()." This reverts commit 57ea148fdbf047a012b361acdc7954e70679dad3. --- src/sm_manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3