rpc: don't leak str/val references passed into announce_publish_info

The code is meant to consume the references.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
2 files changed, 4 insertions(+), 0 deletions(-)

M rpc/announce-info.c
M rpc/include/hlog-rpc/announce-pub.h
M rpc/announce-info.c +3 -0
@@ 92,6 92,9 @@ static void try_pack(struct announce_msg
 		flush_buffer(msg, dst); /* send accumulated info */
 
 	VERIFY0(buffer_copy(dst, &tmp, buffer_size(&tmp)));
+
+	val_putref(name);
+	val_putref(val);
 }
 
 void announce_publish_info(const char *hostname,

          
M rpc/include/hlog-rpc/announce-pub.h +1 -0
@@ 62,6 62,7 @@ static inline void announce_publish_rig(
 	announce_publish(&msg);
 }
 
+/* consumes all the val/str args */
 extern void announce_publish_info(const char *hostname, struct str *contest,
 				  struct str *operator_call,
 				  struct str *tx_country, struct str *tx_state,