From 641b33349b28770fc87da2240902271a6fd3f2f7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 25 Jul 2018 10:03:10 +0930 Subject: [PATCH] peer_control: annotate feature bitfields as being taken. Because tal_dup_arr takes, this does too. Suggested-by: @cdecker Signed-off-by: Rusty Russell --- lightningd/peer_control.c | 2 +- lightningd/peer_control.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 8e79ba346..a74067dc5 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -81,7 +81,7 @@ static void copy_to_parent_log(const char *prefix, struct peer *new_peer(struct lightningd *ld, u64 dbid, const struct pubkey *id, const struct wireaddr_internal *addr, - const u8 *gfeatures, const u8 *lfeatures) + const u8 *gfeatures TAKES, const u8 *lfeatures TAKES) { /* We are owned by our channels, and freed manually by destroy_channel */ struct peer *peer = tal(NULL, struct peer); diff --git a/lightningd/peer_control.h b/lightningd/peer_control.h index 7c5f2530c..4714eeda9 100644 --- a/lightningd/peer_control.h +++ b/lightningd/peer_control.h @@ -58,7 +58,7 @@ struct peer *find_peer_by_dbid(struct lightningd *ld, u64 dbid); struct peer *new_peer(struct lightningd *ld, u64 dbid, const struct pubkey *id, const struct wireaddr_internal *addr, - const u8 *gfeatures, const u8 *lfeatures); + const u8 *gfeatures TAKES, const u8 *lfeatures TAKES); /* Also removes from db. */ void delete_peer(struct peer *peer);