changeset 1330:452b14d88a10

fix small memory leaks
author Marc Weber <marco-oweber@gmx.de>
date Sun, 05 Dec 2010 18:47:54 +0100
parents 9be9da2df74b
children a6427d1eda6f
files src/c/queue.c src/c/urweb.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/queue.c	Sat Dec 11 11:00:05 2010 -0500
+++ b/src/c/queue.c	Sun Dec 05 18:47:54 2010 +0100
@@ -29,8 +29,11 @@
 
 static int dequeue() {
   int ret = front->fd;
+  node n = front->next;
+  free(front);
 
-  front = front->next;
+  front = n;
+
   if (!front)
     back = NULL;
 
--- a/src/c/urweb.c	Sat Dec 11 11:00:05 2010 -0500
+++ b/src/c/urweb.c	Sun Dec 05 18:47:54 2010 +0100
@@ -552,10 +552,12 @@
 
   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);
 }