mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
tal_tmpctx: clear marker for temporary contexts.
This makes them stand out in memory dumps. Also plug two existing memory leaks. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* Simple simulator for protocol. */
|
||||
#include "config.h"
|
||||
#include "utils.h"
|
||||
#include <assert.h>
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <ccan/err/err.h>
|
||||
@@ -412,7 +413,7 @@ static void dump_htlcs(struct htlc **htlcs,
|
||||
int flags_inc, int flags_exc)
|
||||
{
|
||||
size_t i, n = tal_count(htlcs);
|
||||
char *ctx = tal(htlcs, char);
|
||||
const tal_t *ctx = tal_tmpctx(htlcs);
|
||||
bool printed = false;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
|
||||
@@ -1815,7 +1815,7 @@ static void try_input(const struct peer *peer,
|
||||
const char *problem;
|
||||
Pkt *output;
|
||||
const struct bitcoin_tx *broadcast;
|
||||
const tal_t *ctx = tal(NULL, char);
|
||||
const tal_t *ctx = tal_tmpctx(NULL);
|
||||
enum command_status cstatus;
|
||||
|
||||
copy_peers(©, &other, peer);
|
||||
@@ -2220,7 +2220,7 @@ static enum state_input **map_inputs(void)
|
||||
{
|
||||
enum state_input **inps = tal_arr(NULL, enum state_input *, STATE_MAX);
|
||||
unsigned int i;
|
||||
const tal_t *ctx = tal(NULL, char);
|
||||
const tal_t *ctx = tal_tmpctx(NULL);
|
||||
|
||||
for (i = 0; i < STATE_MAX; i++) {
|
||||
/* This is a global */
|
||||
|
||||
Reference in New Issue
Block a user