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) {