chiark / gitweb /
Some configuration-related memory hygeine.
[disorder] / disobedience / login.c
index 36850c11da60b9f201c59da9b0033c3bea1cdedc..90eaa0dde4ddcd30dbd7b4f9065b35a2720538c4 100644 (file)
@@ -120,11 +120,13 @@ static void set_service(struct config *c, const char *s) {
 }
 
 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 */