diff --git a/src/dcc.c b/src/dcc.c index 3ce979ee5..4b0f4162d 100644 --- a/src/dcc.c +++ b/src/dcc.c @@ -360,8 +360,14 @@ static char *get_bot_pass(struct userrec *u) { if (pass2) { if (!pass) { pass = pass2; - if (encrypt_pass) + if (encrypt_pass) { + /* get_user() returns a pointer of struct user_entry + * and set_user()->pass2_set() could free() and realloc it + * so fetch it again with get_user() + */ set_user(&USERENTRY_PASS, u, pass); + pass = get_user(&USERENTRY_PASS2, u); + } } else if (strcmp(pass2, pass) && encrypt_pass2) pass = pass2; } else if (pass && encrypt_pass2)