aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorwxs <wxs@FreeBSD.org>2009-02-27 02:42:19 +0800
committerwxs <wxs@FreeBSD.org>2009-02-27 02:42:19 +0800
commitaf4ac2ad0cd62da2291004aaa9eefc4f82d1b70e (patch)
treea878f6beb1b9bae2e4b85f9aef021e08cfe97d59 /mail
parent98a6330108ec4367568a81d706989a30c7200ba5 (diff)
downloadfreebsd-ports-gnome-af4ac2ad0cd62da2291004aaa9eefc4f82d1b70e.tar.gz
freebsd-ports-gnome-af4ac2ad0cd62da2291004aaa9eefc4f82d1b70e.tar.zst
freebsd-ports-gnome-af4ac2ad0cd62da2291004aaa9eefc4f82d1b70e.zip
- Fix memory leak (patch obtained from OpenBSD)
PR: ports/132119 Submitted by: olli hauer <ohauer@gmx.de> Approved by: Alex Samorukov <samm@os2.kiev.ua> (maintainer)
Diffstat (limited to 'mail')
-rw-r--r--mail/spamd/Makefile1
-rw-r--r--mail/spamd/files/patch-spamd__grey.c68
2 files changed, 69 insertions, 0 deletions
diff --git a/mail/spamd/Makefile b/mail/spamd/Makefile
index d37fd1ace1c0..3655d12b20dd 100644
--- a/mail/spamd/Makefile
+++ b/mail/spamd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= spamd
PORTVERSION= 4.1.2
+PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= BERLIOS
MASTER_SITE_SUBDIR=freebsdspamd
diff --git a/mail/spamd/files/patch-spamd__grey.c b/mail/spamd/files/patch-spamd__grey.c
new file mode 100644
index 000000000000..95d3c2f65dc0
--- /dev/null
+++ b/mail/spamd/files/patch-spamd__grey.c
@@ -0,0 +1,68 @@
+--- spamd/grey.c.orig 2009-02-26 13:27:35.159368721 -0500
++++ spamd/grey.c 2009-02-26 13:31:07.469474893 -0500
+@@ -376,7 +376,7 @@
+ static char buf[MAX_MAIL];
+ char *cp;
+
+- if (*addr == '<');
++ if (*addr == '<')
+ addr++;
+ (void) strlcpy(buf, addr, sizeof(buf));
+ cp = strrchr(buf, '>');
+@@ -398,8 +398,11 @@
+ size_t len;
+ struct mail_addr *m;
+
+- while (!SLIST_EMPTY(&match_suffix))
++ while (!SLIST_EMPTY(&match_suffix)) {
++ m = SLIST_FIRST(&match_suffix);
+ SLIST_REMOVE_HEAD(&match_suffix, entry);
++ free(m);
++ }
+ if ((fp = fopen(alloweddomains_file, "r")) != NULL) {
+ while ((buf = fgetln(fp, &len))) {
+ #ifdef __FreeBSD__
+@@ -410,11 +413,11 @@
+ buf++;
+ len--;
+ }
++ if (len == 0)
++ continue;
+ /* jump over comments and blank lines */
+ if (*buf == '#' || *buf == '\n')
+ continue;
+- if (len == 0)
+- continue;
+ #endif
+ if (buf[len-1] == '\n')
+ len--;
+@@ -434,8 +437,11 @@
+ }
+ return;
+ bad:
+- while (!SLIST_EMPTY(&match_suffix))
++ while (!SLIST_EMPTY(&match_suffix)) {
++ m = SLIST_FIRST(&match_suffix);
+ SLIST_REMOVE_HEAD(&match_suffix, entry);
++ free(m);
++ }
+ }
+
+ void
+@@ -609,6 +615,7 @@
+ dbc->act = 0;
+ dbc->dsiz = 0;
+ SLIST_REMOVE_HEAD(&db_changes, entry);
++ free(dbc);
+
+ }
+ return(ret);
+@@ -795,7 +802,7 @@
+
+ now = time(NULL);
+ /* expiry times have to be in the future */
+- expire = strtonum(expires, now, UINT_MAX, NULL);
++ expire = strtonum(expires, now, INT_MAX, NULL);
+ if (expire == 0)
+ return(-1);
+