fix some memory leaks

This commit is contained in:
Iris Lightshard 2025-01-18 19:01:16 -07:00
parent 31756bc2c9
commit 757db6f529
Signed by: Iris Lightshard
GPG key ID: 688407174966CAF3

View file

@ -178,6 +178,9 @@ void write_scope(Req* r) {
fprintf(stderr, scope->base);
if (u != nil && u->realm != nil && u->realm->universe != nil) {
if (u->scope) {
free(u->scope);
}
u->scope = malloc(r->ifcall.count);
memcpy(u->scope, scope->base, r->ifcall.count);
}
@ -532,6 +535,7 @@ void read_grandom(Req* r) {
uu++;
}
}
free(usrs);
sprintf(buf, "%d\n", u->random);
u->random = -1;
readstr(r, buf);