}
static void set_username(struct config *c, const char *s) {
- c->username = s;
+ xfree(c->username);
+ c->username = xstrdup(s);
}
static void set_password(struct config *c, const char *s) {
- c->password = s;
+ xfree(c->password);
+ c->password = xstrdup(s);
}
/** @brief Table used to generate the form */
/** @brief Save current login details */
static void login_save_config(void) {
- char *path = config_userconf(0, 0), *tmp;
+ char *path = config_userconf(), *tmp;
FILE *fp;
byte_xasprintf(&tmp, "%s.tmp", path);