Fix leak WRT wrbuf usage
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 18 May 2011 07:51:52 +0000 (09:51 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 18 May 2011 07:51:52 +0000 (09:51 +0200)
src/http_command.c

index bbd6b83..4684d26 100644 (file)
@@ -543,7 +543,7 @@ static void cmd_termlist(struct http_channel *c)
     const char *nums = http_argbyname(rq, "num");
     int num = 15;
     int status;
-    WRBUF debug_log = wrbuf_alloc();
+    WRBUF debug_log = 0;
 
     if (!s)
         return;
@@ -557,6 +557,8 @@ static void cmd_termlist(struct http_channel *c)
     if (nums)
         num = atoi(nums);
 
+    debug_log = wrbuf_alloc();
+
     wrbuf_rewind(c->wrbuf);
 
     wrbuf_puts(c->wrbuf, "<termlist>\n");