From: mmj Date: Tue, 18 Jan 2005 13:22:44 +0000 (+1100) Subject: Lets init the strlist before starting to use it X-Git-Tag: RELEASE_1_2_0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee42eba90db661f4622500e797e76eb20c148eb5;p=thirdparty%2Fmlmmj.git Lets init the strlist before starting to use it --- diff --git a/src/mlmmj-send.c b/src/mlmmj-send.c index 043b70a4..fd2ae17c 100644 --- a/src/mlmmj-send.c +++ b/src/mlmmj-send.c @@ -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); diff --git a/src/mlmmj-sub.c b/src/mlmmj-sub.c index ec06a0e6..57f9dad4 100644 --- a/src/mlmmj-sub.c +++ b/src/mlmmj-sub.c @@ -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);