]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Lets init the strlist before starting to use it
authormmj <none@none>
Tue, 18 Jan 2005 13:22:44 +0000 (00:22 +1100)
committermmj <none@none>
Tue, 18 Jan 2005 13:22:44 +0000 (00:22 +1100)
src/mlmmj-send.c
src/mlmmj-sub.c

index 043b70a41e019f7c5430e2cfae00b6ae1bb02437..fd2ae17ccd1df53c588cce29c57e1a90e7e85c82 100644 (file)
@@ -441,6 +441,9 @@ int send_mail_many_fd(int sockfd, const char *from, const char *replyto,
        int res, ret, i;
        struct strlist stl;
 
+       stl.strs = (char **)mymalloc(1 + maxverprecips * sizeof(char *));
+       stl.count = 0;
+
        do {
                res = getaddrsfromfd(&stl, subfd, maxverprecips);
                if(stl.count == maxverprecips) {
@@ -697,6 +700,9 @@ int main(int argc, char **argv)
                exit(EXIT_FAILURE);
        }
 
+       stl.strs = (char **)mymalloc(1 + maxverprecips * sizeof(char *));
+       stl.count = 0;
+
        maxverprecipsstr = ctrlvalue(listdir, "maxverprecips");
        if(maxverprecipsstr) {
                maxverprecips = atol(maxverprecipsstr);
@@ -964,8 +970,6 @@ int main(int argc, char **argv)
                        exit(EXIT_FAILURE);
                }
 
-               stl.strs = (char **)mymalloc(1 + maxverprecips * sizeof(char *));
-               stl.count = 0;
                listname = genlistname(listaddr);       
                listfqdn = genlistfqdn(listaddr);       
                verpfrom = concatstr(5, listname, "+bounces-", strindex, "@",
@@ -1097,6 +1101,10 @@ int main(int argc, char **argv)
                break;
        }
        
+       for(i = 0; i < stl.count; i++)
+               myfree(stl.strs[i]);
+       stl.count = 0;
+
        myfree(hdrs);
        myfree(body);
        myfree(mlmmjbounce);
index ec06a0e6b38b5b9c5a1f5b187189578cf66e78e5..57f9dad44b010af020473454cd9f2b07a83101ac 100644 (file)
@@ -93,7 +93,7 @@ void notify_sub(const char *listdir, const char *listaddr,
 {
        char *maildata[2] = { "newsub", NULL };
        char *listfqdn, *listname, *fromaddr, *tostr;
-       char *queuefilename = NULL, *listtext;
+       char *queuefilename = NULL, *listtext = NULL;
 
        listname = genlistname(listaddr);
        listfqdn = genlistfqdn(listaddr);