aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-16 21:30:55 -0400
committerTest_User <hax@andrewyu.org>2024-06-16 21:30:55 -0400
commite4768d794d676e82db9428148b52aab46292d80e (patch)
tree2fa9dc690f34e90319a7c77098d14ed1401c88a7
parentae2932c5a30b29aa1a0dab6249a5399476771554 (diff)
downloadcoupserv-e4768d794d676e82db9428148b52aab46292d80e.tar.gz
coupserv-e4768d794d676e82db9428148b52aab46292d80e.zip
free bugs [fixed]HEADmaster
-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;