Browse Source

subd: fix false positive if we're inside a subd_req.

We're going to call out to subds for memleak detection, and the disabler
looks like a memleak if we're inside a callback.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
aa62d79db2
  1. 3
      lightningd/subd.c

3
lightningd/subd.c

@ -10,6 +10,7 @@
#include <common/crypto_state.h>
#include <common/gen_peer_status_wire.h>
#include <common/gen_status_wire.h>
#include <common/memleak.h>
#include <errno.h>
#include <fcntl.h>
#include <lightningd/lightningd.h>
@ -91,7 +92,7 @@ static void add_req(const tal_t *ctx,
* case where ctx is freed between request and reply. Hence this
* trick. */
if (ctx) {
sr->disabler = tal(ctx, char);
sr->disabler = notleak(tal(ctx, char));
tal_add_destructor2(sr->disabler, disable_cb, sr);
} else
sr->disabler = NULL;

Loading…
Cancel
Save