From e9fd08a5d571c852f1f47f0e4cead8161a919d0b Mon Sep 17 00:00:00 2001 From: Walter de Jong Date: Thu, 28 Mar 2013 22:55:35 +0100 Subject: added FIXME remark about leaking memory --- libtac/lib/connect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libtac/lib/connect.c b/libtac/lib/connect.c index 1844381..1ec4c5f 100644 --- a/libtac/lib/connect.c +++ b/libtac/lib/connect.c @@ -67,7 +67,7 @@ int tac_connect(struct addrinfo **server, char **key, int servers) { * >= 0 : valid fd * < 0 : error status code, see LIBTAC_STATUS_... */ -int tac_connect_single(struct addrinfo *server, char *key) { +int tac_connect_single(struct addrinfo *server, const char *key) { int retval = LIBTAC_STATUS_CONN_ERR; /* default retval */ int fd = -1; int flags, rc; @@ -83,6 +83,7 @@ int tac_connect_single(struct addrinfo *server, char *key) { } /* format server address into a string for use in messages */ + /* FIXME this leaks memory, ip is not free()d */ ip = tac_ntop(server->ai_addr, 0); if((fd=socket(server->ai_family, server->ai_socktype, server->ai_protocol)) < 0) { -- cgit v1.2.3