summaryrefslogtreecommitdiff
path: root/src/listen.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-04-05 15:05:52 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-04-05 15:05:52 -0700
commitcd900e40b5676874d076c35466fd7baa6a49b1f6 (patch)
treec04168c7db0fcb3e401f09ce4d30a13dd65e7712 /src/listen.c
parent27f9a9324d58c9a7472c724c62f5b7ea0e1f4681 (diff)
downloadxorg-lib-libICE-cd900e40b5676874d076c35466fd7baa6a49b1f6.tar.gz
Replace many malloc(strlen()); strcpy() pairs with strdup()
Diffstat (limited to 'src/listen.c')
-rw-r--r--src/listen.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/listen.c b/src/listen.c
index 9875f30..d3aa4b2 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -177,14 +177,7 @@ IceGetListenConnectionString (listenObj)
IceListenObj listenObj;
{
- char *networkId;
-
- networkId = (char *) malloc (strlen (listenObj->network_id) + 1);
-
- if (networkId)
- strcpy (networkId, listenObj->network_id);
-
- return (networkId);
+ return strdup(listenObj->network_id);
}