diff options
author | Tilman Sauerbeck <tilman@code-monkey.de> | 2007-05-13 11:46:16 +0200 |
---|---|---|
committer | Tilman Sauerbeck <tilman@code-monkey.de> | 2007-05-13 11:46:16 +0200 |
commit | 9bfa1101ac5dbb8d2de1d0431d7e7b281428168f (patch) | |
tree | 977cefd982e648852884d5c61d77c23b1ca60416 /src | |
parent | 24ac7974ef77d7832a8b3ddd300083c41a03cb79 (diff) |
Revert "Don't reinvent the wheel and just use strdup()."
This reverts commit 57ea148fdbf047a012b361acdc7954e70679dad3.
Diffstat (limited to 'src')
-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); } |