summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--event-httpd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/event-httpd.c b/event-httpd.c
index 9943b14..1492fe4 100644
--- a/event-httpd.c
+++ b/event-httpd.c
@@ -107,6 +107,9 @@ static void update(GObject *source, GAsyncResult *res, gpointer user_data)
}
c->resource->update(c, c->resource, line);
+
+ g_free(line);
+
g_data_input_stream_read_line_async(c->data, 0, NULL, update, c);
}
@@ -136,7 +139,9 @@ static void receive(GObject *source, GAsyncResult *res, gpointer user_data)
// line(s) received where a Request-Line is expected.
if (!c->request) {
if (line[0])
- c->request = g_strdup(line);
+ c->request = line;
+ else
+ g_free(line);
g_data_input_stream_read_line_async(c->data, 0, NULL,
receive, c);
@@ -150,11 +155,15 @@ static void receive(GObject *source, GAsyncResult *res, gpointer user_data)
if (g_str_has_prefix(line, "X-Forwarded-"))
c->forwarded = TRUE;
+ g_free(line);
+
g_data_input_stream_read_line_async(c->data, 0, NULL,
receive, c);
return;
}
+ g_free(line);
+
// End of request. Parse it.
// Find the URI
uri = strchr(c->request, ' ');