| 629 | } |
| 630 | |
| 631 | static struct io_plan *handle_memleak(struct io_conn *conn, |
| 632 | struct client *c, |
| 633 | const u8 *msg_in) |
| 634 | { |
| 635 | struct htable *memtable; |
| 636 | bool found_leak; |
| 637 | u8 *reply; |
| 638 | |
| 639 | memtable = memleak_start(tmpctx); |
| 640 | memleak_ptr(memtable, msg_in); |
| 641 | |
| 642 | /* Now note clients and anything they point to. */ |
| 643 | memleak_scan_region(memtable, dbid_zero_clients, sizeof(dbid_zero_clients)); |
| 644 | memleak_scan_uintmap(memtable, &clients); |
| 645 | memleak_scan_obj(memtable, status_conn); |
| 646 | memleak_scan_obj(memtable, hsm_secret); |
| 647 | |
| 648 | memleak_ptr(memtable, dev_force_privkey); |
| 649 | memleak_ptr(memtable, dev_force_bip32_seed); |
| 650 | |
| 651 | found_leak = dump_memleak(memtable, memleak_status_broken, NULL); |
| 652 | reply = towire_hsmd_dev_memleak_reply(NULL, found_leak); |
| 653 | return req_reply(conn, c, take(reply)); |
| 654 | } |
| 655 | |
| 656 | u8 *hsmd_status_bad_request(struct hsmd_client *client, const u8 *msg, const char *error) |
| 657 | { |
no test coverage detected