summaryrefslogtreecommitdiff
path: root/src/setauth.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/setauth.c
parent27f9a9324d58c9a7472c724c62f5b7ea0e1f4681 (diff)
Replace many malloc(strlen()); strcpy() pairs with strdup()
Diffstat (limited to 'src/setauth.c')
-rw-r--r--src/setauth.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/setauth.c b/src/setauth.c
index 4fd7718..8ed9cef 100644
--- a/src/setauth.c
+++ b/src/setauth.c
@@ -96,20 +96,14 @@ IceAuthDataEntry *entries;
_IcePaAuthDataEntryCount++;
}
- _IcePaAuthDataEntries[j].protocol_name = (char *) malloc (
- strlen (entries[i].protocol_name) + 1);
- strcpy (_IcePaAuthDataEntries[j].protocol_name,
- entries[i].protocol_name);
-
- _IcePaAuthDataEntries[j].network_id = (char *) malloc (
- strlen (entries[i].network_id) + 1);
- strcpy (_IcePaAuthDataEntries[j].network_id,
- entries[i].network_id);
-
- _IcePaAuthDataEntries[j].auth_name = (char *) malloc (
- strlen (entries[i].auth_name) + 1);
- strcpy (_IcePaAuthDataEntries[j].auth_name,
- entries[i].auth_name);
+ _IcePaAuthDataEntries[j].protocol_name
+ = strdup(entries[i].protocol_name);
+
+ _IcePaAuthDataEntries[j].network_id
+ = strdup(entries[i].network_id);
+
+ _IcePaAuthDataEntries[j].auth_name
+ = strdup(entries[i].auth_name);
_IcePaAuthDataEntries[j].auth_data_length =
entries[i].auth_data_length;