aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server_network.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/server_network.c b/server_network.c
index 8676cc3..10b2023 100644
--- a/server_network.c
+++ b/server_network.c
@@ -339,7 +339,6 @@ int opertype_handler(struct string sender, uint64_t argc, struct string *argv) {
return 1;
}
- free(user->opertype.data);
struct string opertype = {.data = malloc(argv[0].len), .len = argv[0].len};
if (!opertype.data) {
WRITES(2, STRING("OOM! (opertype_handler)\n"));
@@ -347,8 +346,7 @@ int opertype_handler(struct string sender, uint64_t argc, struct string *argv) {
}
memcpy(opertype.data, argv[0].data, argv[0].len);
- if (user->opertype.len)
- free(user->opertype.data);
+ free(user->opertype.data);
user->opertype = opertype;