changeset 464:5177ad983444

don't mystrdup unless needed
author mmj
date Tue, 15 Feb 2005 05:52:08 +1100
parents 030dfa571be4
children 7d527f44b368
files ChangeLog VERSION src/mlmmj-sub.c src/mlmmj-unsub.c
diffstat 4 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 14 20:32:02 2005 +1100
+++ b/ChangeLog	Tue Feb 15 05:52:08 2005 +1100
@@ -1,3 +1,4 @@
+1.2.4
  o Unlink totally harmless .lock files in subscribers dir.
  o Make it possible to specify more than one listaddress in
    LISTDIR/control/listaddress. The first one is the "real" one.
--- a/VERSION	Mon Feb 14 20:32:02 2005 +1100
+++ b/VERSION	Tue Feb 15 05:52:08 2005 +1100
@@ -1,1 +1,1 @@
-1.2.3
+1.2.4
--- a/src/mlmmj-sub.c	Mon Feb 14 20:32:02 2005 +1100
+++ b/src/mlmmj-sub.c	Tue Feb 15 05:52:08 2005 +1100
@@ -359,13 +359,13 @@
 	switch(typesub) {
 		default:
 		case SUB_NORMAL:
-			subdir = mystrdup("/subscribers.d/");
+			subdir = "/subscribers.d/";
 			break;
 		case SUB_DIGEST:
-			subdir = mystrdup("/digesters.d/");
+			subdir = "/digesters.d/";
 			break;
 		case SUB_NOMAIL:
-			subdir = mystrdup("/nomailsubs.d/");
+			subdir = "/nomailsubs.d/";
 			break;
 	}
 		
@@ -380,8 +380,6 @@
 		exit(EXIT_FAILURE);
 	}
 
-	myfree(subdir);
-
 	sublock = myexcllock(sublockfd);
 	if(sublock < 0) {
 		log_error(LOG_ARGS, "Error locking '%s' file",
--- a/src/mlmmj-unsub.c	Mon Feb 14 20:32:02 2005 +1100
+++ b/src/mlmmj-unsub.c	Tue Feb 15 05:52:08 2005 +1100
@@ -381,13 +381,13 @@
 	switch(typesub) {
 		default:
 		case SUB_NORMAL:
-			subdir = mystrdup("/subscribers.d/");
+			subdir = "/subscribers.d/";
 			break;
 		case SUB_DIGEST:
-			subdir = mystrdup("/digesters.d/");
+			subdir = "/digesters.d/";
 			break;
 		case SUB_NOMAIL:
-			subdir = mystrdup("/nomailsubs.d/");
+			subdir = "/nomailsubs.d/";
 			break;
 	}
 		
@@ -402,7 +402,6 @@
 	if(is_subbed_in(subddirname, address)) {
 		/* Address is not subscribed, so exit silently */
 		myfree(subddirname);
-		myfree(subdir);
 		myfree(listaddr);
 		exit(EXIT_SUCCESS);
 	}
@@ -415,7 +414,6 @@
 		log_error(LOG_ARGS, "Could not opendir(%s)",
 				    subddirname);
 		myfree(subddirname);
-		myfree(subdir);
 		myfree(listaddr);
 		exit(EXIT_FAILURE);
 	}
@@ -563,7 +561,6 @@
         }
 
 	closedir(subddir);
-	myfree(subdir);
 
         notifysub = statctrl(listdir, "notifysub");