From aab43573fc8722815cc61463de942edbf48b5e83 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Fri, 22 May 1998 19:54:35 +0000 Subject: [PATCH] remove use of strdup git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4901 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/otp/otp_challenge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/otp/otp_challenge.c b/lib/otp/otp_challenge.c index 9ac40cadc..528da2556 100644 --- a/lib/otp/otp_challenge.c +++ b/lib/otp/otp_challenge.c @@ -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";