diff --git a/src/command/commands.c b/src/command/commands.c index 2b7136f2..b1a829b5 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -137,7 +137,7 @@ cmd_connect(gchar **args, struct cmd_help_t help) if(stream){ // Limit to READ_BUF_SIZE bytes to prevent overflows in the case of a poorly chosen command account->password = g_malloc(READ_BUF_SIZE); - fgets(account->password, READ_BUF_SIZE, stream); + account->password = fgets(account->password, READ_BUF_SIZE, stream); pclose(stream); } else { log_error("popen failed when running eval_password."); diff --git a/tests/test_cmd_rooms.c b/tests/test_cmd_rooms.c index 9b99a34a..5114bfbf 100644 --- a/tests/test_cmd_rooms.c +++ b/tests/test_cmd_rooms.c @@ -61,6 +61,7 @@ void cmd_rooms_uses_account_default_when_no_arg(void **state) account->name = NULL; account->jid = NULL; account->password = NULL; + account->eval_password = NULL; account->resource = NULL; account->server = NULL; account->last_presence = NULL;