summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Marc Weber <marco-oweber@gmx.de>2010-12-05 18:47:54 +0100
committerGravatar Marc Weber <marco-oweber@gmx.de>2010-12-05 18:47:54 +0100
commit6579a7ec814539ea627f69e89a114ecd92f83699 (patch)
tree94321d7b3cd561f1fa3cd5df0b9f5d4599fd2bb4 /src
parentf3a11513f4bc3e360ed17bad4a803032340eae29 (diff)
fix small memory leaks
Diffstat (limited to 'src')
-rw-r--r--src/c/queue.c5
-rw-r--r--src/c/urweb.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/c/queue.c b/src/c/queue.c
index cdd871b8..645f69e3 100644
--- a/src/c/queue.c
+++ b/src/c/queue.c
@@ -29,8 +29,11 @@ static void enqueue(int fd) {
static int dequeue() {
int ret = front->fd;
+ node n = front->next;
+ free(front);
+
+ front = n;
- front = front->next;
if (!front)
back = NULL;
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 91c6f6b3..392108fe 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -552,10 +552,12 @@ void uw_free(uw_context ctx) {
for (i = 0; i < ctx->n_deltas; ++i)
buf_free(&ctx->deltas[i].msgs);
+ free(ctx->deltas);
for (i = 0; i < ctx->n_globals; ++i)
if (ctx->globals[i].free)
ctx->globals[i].free(ctx->globals[i].data);
+ free(ctx->globals);
free(ctx);
}