Hi, list.

There is obvious memory leak in wap-appl.c

    ret = wml_compile(content->body, content->charset, &wmlc,
                      content->version);

If you will check wml_compile function from wml_compiler.c, than you'll see that
it allocates "wmlc" at the start and doesn't deallocate it even if
we have compilation error.
So in case of compilation error we must free it in wap-appl.c

Provided patch fixes this problem.


-- Vjacheslav Chekushin mailto:[EMAIL PROTECTED] Latvian Mobile Phone Company http://www.lmt.lv
--- ../gateway_base/gw/wap-appl.c       Thu Oct  9 15:04:18 2003
+++ gw/wap-appl.c       Thu Oct 23 16:58:37 2003
@@ -1230,6 +1230,7 @@
     if (ret == 0)
         return wmlc;
 
+    octstr_destroy(wmlc);
     warning(0, "WSP: WML compilation failed.");
     return NULL;
 }

Reply via email to