summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org>2016-02-21 14:29:37 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2016-02-21 14:29:37 (GMT)
commit910b8cf881052050c0edade38d0f9de8cdacf3c6 (patch) (side-by-side diff)
treee13b48bc0782df22ef989c3dd942ef8496cb36d6 /src
parent722533c595a0976e50cca45dca7f28ff7e599970 (diff)
downloadpies-910b8cf881052050c0edade38d0f9de8cdacf3c6.tar.gz
pies-910b8cf881052050c0edade38d0f9de8cdacf3c6.tar.bz2
Fix memory leaks
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ctl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 3cbe459..7d44cf1 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -252,6 +252,9 @@ input_destroy (struct input *inp)
{
ctlbuf_free (&inp->ibuf);
grecs_symtab_free (inp->headers);
+ free (inp->input_method);
+ free (inp->input_uri);
+ free (inp->input_proto);
}
static void
@@ -259,9 +262,16 @@ input_reset (struct input *inp)
{
inp->input_state = is_initial;
grecs_symtab_clear (inp->headers);
+
+ free (inp->input_method);
inp->input_method = NULL;
+
+ free (inp->input_uri);
inp->input_uri = NULL;
+
+ free (inp->input_proto);
inp->input_proto = NULL;
+
inp->input_content_length = 0;
ctlbuf_flush (&inp->ibuf);
}
@@ -1972,7 +1982,7 @@ select_and_run (struct ctlio *io, struct pcond_node *cond,
env.io = io;
env.cond = cond;
env.fun = NULL;
- env.result = json_new_array ();
+ env.result = NULL;
switch (meth)
{

Return to:

Send suggestions and report system problems to the System administrator.