forked from noisytoot/rubyserv-iirc
free bugs [fixed]
This commit is contained in:
parent
ae2932c5a3
commit
e4768d794d
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue