remove use of strdup

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4901 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-05-22 19:54:35 +00:00
parent 6eb47a5b02
commit aab43573fc

View File

@@ -51,11 +51,12 @@ otp_challenge (OtpContext *ctx, char *user, char *str, size_t len)
ctx->challengep = 0;
ctx->err = NULL;
ctx->user = strdup(user);
ctx->user = malloc(strlen(user) + 1);
if (ctx->user == NULL) {
ctx->err = "Out of memory";
return -1;
}
strcpy(ctx->user, user);
dbm = otp_db_open ();
if (dbm == NULL) {
ctx->err = "Cannot open database";