aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-02-21 16:29:37 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-02-21 16:29:37 +0200
commit910b8cf881052050c0edade38d0f9de8cdacf3c6 (patch)
treee13b48bc0782df22ef989c3dd942ef8496cb36d6
parent722533c595a0976e50cca45dca7f28ff7e599970 (diff)
downloadpies-910b8cf881052050c0edade38d0f9de8cdacf3c6.tar.gz
pies-910b8cf881052050c0edade38d0f9de8cdacf3c6.tar.bz2
Fix memory leaks
m---------grecs0
-rw-r--r--src/ctl.c12
2 files changed, 11 insertions, 1 deletions
diff --git a/grecs b/grecs
-Subproject a3f25ce24dcaff123fb71db89419d3ae12ddb57
+Subproject 07838fb2e9ed5769074add028e052a3b667e67e
diff --git a/src/ctl.c b/src/ctl.c
index 3cbe459..7d44cf1 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -249,22 +249,32 @@ input_init (struct input *inp)
static void
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
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);
}
static int
input_append (struct input *inp, char c)
@@ -1969,13 +1979,13 @@ select_and_run (struct ctlio *io, struct pcond_node *cond,
int wakeup = 0;
memset (&env, 0, sizeof (env));
env.io = io;
env.cond = cond;
env.fun = NULL;
- env.result = json_new_array ();
+ env.result = NULL;
switch (meth)
{
case METH_GET:
env.allowed_state = CTL_USER_STATE | CTL_ADMIN_STATE;
env.fun = fun_list;

Return to:

Send suggestions and report system problems to the System administrator.