From e4768d794d676e82db9428148b52aab46292d80e Mon Sep 17 00:00:00 2001 From: Test_User Date: Sun, 16 Jun 2024 21:30:55 -0400 Subject: free bugs [fixed] --- server_network.c | 4 +--- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.3