From 072d0d136055212439d11464b32cfcda7e8d17ee Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Mon, 12 Oct 2009 08:28:44 +0200 Subject: [PATCH] Plug some memory leaks --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.c b/src/main.c index 1449ea9..1c7e9cb 100644 --- a/src/main.c +++ b/src/main.c @@ -138,6 +138,7 @@ static int send_response(struct MHD_Connection *conn, MHD_YES, MHD_YES); r = MHD_queue_response(conn, MHD_HTTP_OK, response); MHD_destroy_response(response); + free(resp_text); if (r == MHD_YES) return 0; return -1; @@ -232,6 +233,7 @@ static int set_data_for_uid(char *uid, struct ykc_stats *stats) /* XXX Better error handling.*/ } assert(PQntuples(res) == 0); + PQclear(res); return 0; } @@ -274,6 +276,7 @@ static int get_data_for_uid(char *uid, struct ykc_stats *stats) tmp = PQgetvalue(res, 0, PQfnumber(res, "session_use")); stats->session_use = ntohl(*((uint32_t *) tmp)); stats->public_id = NULL; + PQclear(res); return 0; } -- 2.39.5