fix some memory leaks
This commit is contained in:
parent
31756bc2c9
commit
757db6f529
1 changed files with 4 additions and 0 deletions
|
@ -178,6 +178,9 @@ void write_scope(Req* r) {
|
||||||
fprintf(stderr, scope->base);
|
fprintf(stderr, scope->base);
|
||||||
|
|
||||||
if (u != nil && u->realm != nil && u->realm->universe != nil) {
|
if (u != nil && u->realm != nil && u->realm->universe != nil) {
|
||||||
|
if (u->scope) {
|
||||||
|
free(u->scope);
|
||||||
|
}
|
||||||
u->scope = malloc(r->ifcall.count);
|
u->scope = malloc(r->ifcall.count);
|
||||||
memcpy(u->scope, scope->base, r->ifcall.count);
|
memcpy(u->scope, scope->base, r->ifcall.count);
|
||||||
}
|
}
|
||||||
|
@ -532,6 +535,7 @@ void read_grandom(Req* r) {
|
||||||
uu++;
|
uu++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(usrs);
|
||||||
sprintf(buf, "%d\n", u->random);
|
sprintf(buf, "%d\n", u->random);
|
||||||
u->random = -1;
|
u->random = -1;
|
||||||
readstr(r, buf);
|
readstr(r, buf);
|
||||||
|
|
Loading…
Reference in a new issue