From e0845c95210ca7cf4a03be23b034a2f29fc078c6 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 4 Jul 2007 04:27:32 +0000 Subject: [PATCH] Use strdup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19671 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/generic/util_buffer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/gssapi/generic/util_buffer.c b/src/lib/gssapi/generic/util_buffer.c index 77cb2eb2f..9b814b00a 100644 --- a/src/lib/gssapi/generic/util_buffer.c +++ b/src/lib/gssapi/generic/util_buffer.c @@ -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); } -- 2.26.2