Use strdup
authorKen Raeburn <raeburn@mit.edu>
Wed, 4 Jul 2007 04:27:32 +0000 (04:27 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 4 Jul 2007 04:27:32 +0000 (04:27 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19671 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/generic/util_buffer.c

index 77cb2eb2ffe4d26017f1368b619f33828f9e35be..9b814b00a167a280d869eb55467ca266eff221be 100644 (file)
@@ -37,12 +37,10 @@ int g_make_string_buffer(str, buffer)
 {
    buffer->length = strlen(str);
 
-   if ((buffer->value = (void *) xmalloc(buffer->length + 1)) == NULL) {
+   if ((buffer->value = strdup(str)) == NULL) {
       buffer->length = 0;
       return(0);
    }
 
-   strcpy(buffer->value, str);
-
    return(1);
 }