Vjacheslav Chekushin wrote:

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.



------------------------------------------------------------------------

--- ../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;
}

+1, we octstr_create() it in gw/wml_compiler.c:wml_compiler() and do not _destroy() it anywhere.


commiting to cvs. Thanks a lot.

Stipe

mailto:stolj_{at}_wapme.de
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf, NRW, Germany

phone: +49.211.74845.0
fax: +49.211.74845.299

mailto:info_{at}_wapme-systems.de
http://www.wapme-systems.de/
-------------------------------------------------------------------

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.2 (Cygwin)

mIsEP6mcYwEEAMDnUiUwrbb+xwTFWN6TxF2+XZu7/alwJMeCwMBRvXtPZqfjpPhS
OkBpU0F4TrVuugz1HINTSaJTYq10AzDQXp5NkyWgckqW79nPAWuOX0dicbJk+cN2
nM2TI4KaxUDe6u8hghNEnH/i2lXsUu9apnP/iixzV81VC2je3uc9hZpnAAYptEVT
dGlwZSBUb2xqIChUZWNobm9sb2d5IENlbnRlciAmIFJlc2VhcmNoIExhYikgPHRv
bGpAd2FwbWUtc3lzdGVtcy5kZT6ItAQTAQIAHgUCP6mcYwIbAwYLCQgHAwIDFQID
AxYCAQIeAQIXgAAKCRABV0w1BqPYRuSqA/wPzsQxao2YePENCtgRTrO86U6zg3sl
OcS6CJFI4FZP5h/xD3GRsNH1+MPSvZlomDdpFnr547DGz/Kq9MXuQwVvlVig5yWZ
K5dtKp1r5YLhxJQBhfirZbRFFnYmf19f18J8OoS28tuFVftDl1AIwJS3HLyBTv6H
g2HyLAEKQIp30Q==
=aYCI
-----END PGP PUBLIC KEY BLOCK-----



Reply via email to