mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
gossipd: free tmpctx children in gossip_store_load loop.
We're accumulating children, and we'll get more in the successive patches. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
3ef767fd52
commit
cb297b0a1b
1 changed files with 2 additions and 2 deletions
|
@ -438,7 +438,7 @@ void gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)
|
|||
read(fd, &becsum, sizeof(becsum)) == sizeof(becsum)) {
|
||||
msglen = be32_to_cpu(belen);
|
||||
checksum = be32_to_cpu(becsum);
|
||||
msg = tal_arr(gs, u8, msglen);
|
||||
msg = tal_arr(tmpctx, u8, msglen);
|
||||
|
||||
if (read(fd, msg, msglen) != msglen) {
|
||||
status_unusual("gossip_store: truncated file?");
|
||||
|
@ -496,7 +496,7 @@ void gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)
|
|||
}
|
||||
gs->len += sizeof(belen) + sizeof(becsum) + msglen;
|
||||
gs->count++;
|
||||
tal_free(msg);
|
||||
clean_tmpctx();
|
||||
}
|
||||
goto out;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue