diff options
author | Greg Hudson <ghudson@mit.edu> | 2008-10-20 18:18:49 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2008-10-20 18:18:49 +0000 |
commit | e4a2f122c3086c1179323c0e24edb3506d3f4758 (patch) | |
tree | 310614d952144eaba5f2e0a1aec7f86af40862de /src/ccapi | |
parent | 4c6801514e9ee5e6459780d37bc4a83429dd4746 (diff) | |
download | krb5-e4a2f122c3086c1179323c0e24edb3506d3f4758.zip krb5-e4a2f122c3086c1179323c0e24edb3506d3f4758.tar.gz krb5-e4a2f122c3086c1179323c0e24edb3506d3f4758.tar.bz2 |
Use strdup in place of malloc/strcpy in many places
ticket: 6200
status: open
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20898 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi')
-rw-r--r-- | src/ccapi/lib/ccapi_string.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ccapi/lib/ccapi_string.c b/src/ccapi/lib/ccapi_string.c index 4acd9a8..4f4db6f 100644 --- a/src/ccapi/lib/ccapi_string.c +++ b/src/ccapi/lib/ccapi_string.c @@ -67,10 +67,8 @@ cc_int32 cci_string_new (cc_string_t *out_string, } if (!err) { - string->data = malloc (strlen (in_cstring) + 1); - if (string->data) { - strcpy ((char *)string->data, in_cstring); - } else { + string->data = strdup (in_cstring); + if (!string->data) { err = cci_check_error (ccErrNoMem); } |