https://bugs.freedesktop.org/show_bug.cgi?id=61851
--- Comment #1 from Patrick Ohly <patrick.ohly(a)gmx.de> ---
From: Werner Baumann <werner.baumann(a)onlinehome.de>
To: neon(a)lists.manyfish.co.uk
Subject: Memory leak when using GnuTLS
Date: Sat, 24 May 2014 17:39:17 +0200
Hello,
a user of davfs2 reported ever growing use of real memory. A test
showed that this only happens when Neon is compiled against GnuTLS but
not when OpenSSL is used.
For example: when I create 10000 files I will get:
Neon with OpenSSL: about 5 MB of real memory (expected usage by davfs2)
Neon with GnuTLS: about 30 MB of real memory (about 25 MB leaked).
This seems to be the same error as reported in
http://lists.manyfish.co.uk/pipermail/neon/2013-January/001526.html
The error is in ne_gnutls.c around line 677, function
ne_ssl_context_destroy:
void ne_ssl_context_destroy(ne_ssl_context *ctx)
{
gnutls_certificate_free_credentials(ctx->cred);
if (ctx->cache.client.data) {
ne_free(ctx->cache.client.data);
} else if (ctx->cache.server.key.data) {
gnutls_free(ctx->cache.server.key.data);
gnutls_free(ctx->cache.server.data.data);
}
ne_free(ctx);
}
It uses ne_free for data allocated by GnuTLS. It should use
gnutls_free. The memory leak disappears when I change it like this:
void ne_ssl_context_destroy(ne_ssl_context *ctx)
{
gnutls_certificate_free_credentials(ctx->cred);
if (ctx->cache.client.data) {
gnutls_free(ctx->cache.client.data);
} else if (ctx->cache.server.key.data) {
gnutls_free(ctx->cache.server.key.data);
gnutls_free(ctx->cache.server.data.data);
}
ne_free(ctx);
}
I tested with Neon 0.29.5 but the code in the git repository is the
same.
Cheers
Werner
--
You are receiving this mail because:
You are on the CC list for the bug.