diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-05 15:05:52 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-05 15:05:52 -0700 |
commit | cd900e40b5676874d076c35466fd7baa6a49b1f6 (patch) | |
tree | c04168c7db0fcb3e401f09ce4d30a13dd65e7712 /src/accept.c | |
parent | 27f9a9324d58c9a7472c724c62f5b7ea0e1f4681 (diff) |
Replace many malloc(strlen()); strcpy() pairs with strdup()
Diffstat (limited to 'src/accept.c')
-rw-r--r-- | src/accept.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/accept.c b/src/accept.c index df2b258..d54ffd4 100644 --- a/src/accept.c +++ b/src/accept.c @@ -92,8 +92,7 @@ IceAcceptStatus *statusRet; iceConn->send_sequence = 0; iceConn->receive_sequence = 0; - iceConn->connection_string = (char *) malloc ( - strlen (listenObj->network_id) + 1); + iceConn->connection_string = strdup(listenObj->network_id); if (iceConn->connection_string == NULL) { @@ -102,8 +101,6 @@ IceAcceptStatus *statusRet; *statusRet = IceAcceptBadMalloc; return (NULL); } - else - strcpy (iceConn->connection_string, listenObj->network_id); iceConn->vendor = NULL; iceConn->release = NULL; |