MCPcopy Create free account
hub / github.com/ElementsProject/lightning / handle_memleak

Function handle_memleak

hsmd/hsmd.c:550–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548
549#if DEVELOPER
550static struct io_plan *handle_memleak(struct io_conn *conn,
551 struct client *c,
552 const u8 *msg_in)
553{
554 struct htable *memtable;
555 bool found_leak;
556 u8 *reply;
557
558 memtable = memleak_start(tmpctx);
559 memleak_ptr(memtable, msg_in);
560
561 /* Now note clients and anything they point to. */
562 memleak_scan_region(memtable, dbid_zero_clients, sizeof(dbid_zero_clients));
563 memleak_scan_uintmap(memtable, &clients);
564 memleak_scan_obj(memtable, status_conn);
565
566 memleak_ptr(memtable, dev_force_privkey);
567 memleak_ptr(memtable, dev_force_bip32_seed);
568
569 found_leak = dump_memleak(memtable, memleak_status_broken);
570 reply = towire_hsmd_dev_memleak_reply(NULL, found_leak);
571 return req_reply(conn, c, take(reply));
572}
573#endif /* DEVELOPER */
574
575u8 *hsmd_status_bad_request(struct hsmd_client *client, const u8 *msg, const char *error)

Callers 1

handle_clientFunction · 0.85

Calls 6

req_replyFunction · 0.85
memleak_startFunction · 0.50
memleak_ptrFunction · 0.50
memleak_scan_regionFunction · 0.50
memleak_scan_objFunction · 0.50
dump_memleakFunction · 0.50

Tested by

no test coverage detected