summaryrefslogtreecommitdiff
path: root/src/setauth.c
diff options
context:
space:
mode:
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;