"strdup" does always create a new object in the memory (through "malloc") which
needs to be freed if it isn't used anymore.
free (ctx->pre_auth_types);
if (ctx->in_tkt_service)
free(ctx->in_tkt_service);
+ if (ctx->password)
+ free(ctx->password);
if (ctx->keytab_data)
free(ctx->keytab_data);
krb5_data_free(&ctx->req_buffer);
const char *password)
{
if (ctx->password)
- memset(ctx->password, 0, strlen(ctx->password));
+ free(ctx->password);
if (password) {
ctx->password = strdup(password);
if (ctx->password == NULL) {