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/setauth.c | |
parent | 27f9a9324d58c9a7472c724c62f5b7ea0e1f4681 (diff) |
Replace many malloc(strlen()); strcpy() pairs with strdup()
Diffstat (limited to 'src/setauth.c')
-rw-r--r-- | src/setauth.c | 22 |
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; |