From 4272f89b1acba33b9de43ab7767f59cd4647daa5 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 21 Aug 2016 14:13:28 +1000 Subject: [PATCH] attempt to fix double free --- www.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www.c b/www.c index b9051db..d16cb5c 100644 --- a/www.c +++ b/www.c @@ -40,6 +40,8 @@ void *www_logger(void * cls, const char * uri, struct MHD_Connection *con) { struct sockaddr_in *so = (struct sockaddr_in *)MHD_get_connection_info(con, MHD_CONNECTION_INFO_CLIENT_ADDRESS)->client_addr; ipaddress = strdup(inet_ntoa(so->sin_addr)); dolog("%s", uri); + free(ipaddress); + ipaddress = NULL; return NULL; } @@ -76,7 +78,6 @@ void www_request_completed(void *cls, struct MHD_Connection *connection, void ** free(con_info->url); free(con_info); - free(ipaddress); } static int iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size) {