Fix huge memory leak (16M per every hashed file).

Approved by:	MAINTAINER
This commit is contained in:
Max Khon
2010-02-06 21:28:12 +00:00
parent 2f3ab82ac9
commit 14fb0a97f5
2 changed files with 21 additions and 1 deletions

View File

@@ -7,7 +7,7 @@
PORTNAME= linuxdcpp
PORTVERSION= 1.0.3
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= net-p2p
MASTER_SITES= ${MASTER_SITE_LOCAL} http://freebsd.nsu.ru/distfiles/
MASTER_SITE_SUBDIR= danfe

View File

@@ -0,0 +1,20 @@
--- client/HashManager.cpp.orig 2010-02-06 12:57:41.000000000 +0600
+++ client/HashManager.cpp 2010-02-06 12:58:04.000000000 +0600
@@ -636,13 +636,13 @@
currentSize = max(static_cast<uint64_t>(currentSize - size_read), static_cast<uint64_t>(0));
}
- if(size_left <= 0) {
- break;
- }
-
munmap(buf, size_read);
pos += size_read;
size_left -= size_read;
+
+ if(size_left <= 0) {
+ break;
+ }
}
close(fd);
return true;