mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
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>
This commit is contained in:
committed by
Christian Decker
parent
37ea0d3c7f
commit
aa62d79db2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user