* [gentoo-commits] gentoo-x86 commit in net-fs/curlftpfs/files: curlftpfs-0.9.2-memleak.patch curlftpfs-0.9.2-memleak-nocache.patch
@ 2013-06-06 20:37 Sergei Trofimovich (slyfox)
0 siblings, 0 replies; only message in thread
From: Sergei Trofimovich (slyfox) @ 2013-06-06 20:37 UTC (permalink / raw
To: gentoo-commits
slyfox 13/06/06 20:37:14
Added: curlftpfs-0.9.2-memleak.patch
curlftpfs-0.9.2-memleak-nocache.patch
Log:
Added myself as a maintainer. Plugged known memory leaks fixed in debian and fedora.
(Portage version: 2.2.0_alpha177_p3/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
Revision Changes Path
1.1 net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch?rev=1.1&content-type=text/plain
Index: curlftpfs-0.9.2-memleak.patch
===================================================================
Picked-from: https://github.com/jomat/curlftpfs/commit/b8ce5599a17a1f9e00c93cff3a81fe88f51e8bd3
Upstream-bug: https://sourceforge.net/tracker/?func=detail&aid=2924678&group_id=160565&atid=816357
commit b8ce5599a17a1f9e00c93cff3a81fe88f51e8bd3
Author: jomat <jomat@copete.de>
Date: Sun Oct 16 18:41:37 2011 +0000
added patch agains memory leak
see also https://sourceforge.net/tracker/?func=detail&aid=2924678&group_id=160565&atid=816357
diff --git a/ftpfs.c b/ftpfs.c
index 0346354..96146f7 100644
--- a/ftpfs.c
+++ b/ftpfs.c
@@ -615,6 +615,8 @@ static void free_ftpfs_file(struct ftpfs_file *fh) {
sem_destroy(&fh->data_need);
sem_destroy(&fh->data_written);
sem_destroy(&fh->ready);
+ if (fh->buf.size) { buf_free(&fh->buf); }
+ if (fh->stream_buf.size) { buf_free(&fh->stream_buf); }
free(fh);
}
1.1 net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch?rev=1.1&content-type=text/plain
Index: curlftpfs-0.9.2-memleak-nocache.patch
===================================================================
Picked-from: http://pkgs.fedoraproject.org/cgit/curlftpfs.git/tree/curlftpfs-0.9.2-memleak-cached%23591299.patch?h=f18
@@ -, +, @@
---
cache.c | 2 1 + 1 - 0 !
ftpfs-ls.c | 19 15 + 4 - 0 !
2 files changed, 16 insertions(+), 5 deletions(-)
--- b/cache.c
+++ b/cache.c
@@ -25,7 +25,7 @@ struct cache {
time_t last_cleaned;
};
-static struct cache cache;
+struct cache cache;
struct node {
struct stat stat;
--- b/ftpfs-ls.c
+++ b/ftpfs-ls.c
@@ -25,6 +25,13 @@
#include "charset_utils.h"
#include "ftpfs-ls.h"
+struct cache {
+ int on;
+ char incomplete[];
+};
+
+extern struct cache cache;
+
static int parse_dir_unix(const char *line,
struct stat *sbuf,
char *file,
@@ -243,8 +250,10 @@ int parse_dir(const char* list, const ch
reallink = g_strdup(link);
}
int linksize = strlen(reallink);
- cache_add_link(full_path, reallink, linksize+1);
- DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
+ if (cache.on) {
+ cache_add_link(full_path, reallink, linksize+1);
+ DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
+ }
if (linkbuf && linklen) {
if (linksize > linklen) linksize = linklen - 1;
strncpy(linkbuf, reallink, linksize);
@@ -257,8 +266,10 @@ int parse_dir(const char* list, const ch
DEBUG(1, "filler: %s\n", file);
filler(h, file, &stat_buf);
} else {
- DEBUG(1, "cache_add_attr: %s\n", full_path);
- cache_add_attr(full_path, &stat_buf);
+ if (cache.on) {
+ DEBUG(1, "cache_add_attr: %s\n", full_path);
+ cache_add_attr(full_path, &stat_buf);
+ }
}
DEBUG(2, "comparing %s %s\n", name, file);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-06-06 20:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06 20:37 [gentoo-commits] gentoo-x86 commit in net-fs/curlftpfs/files: curlftpfs-0.9.2-memleak.patch curlftpfs-0.9.2-memleak-nocache.patch Sergei Trofimovich (slyfox)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox