Mercurial > hg > mlmmj
changeset 432:2a3886ef3c75
Lets init the strlist before starting to use it
author | mmj |
---|---|
date | Wed, 19 Jan 2005 00:22:44 +1100 |
parents | 37671335fe17 |
children | 3ec583965492 |
files | src/mlmmj-send.c src/mlmmj-sub.c |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mlmmj-send.c Tue Jan 18 21:47:42 2005 +1100 +++ b/src/mlmmj-send.c Wed Jan 19 00:22:44 2005 +1100 @@ -441,6 +441,9 @@ 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 @@ 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 @@ 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 @@ break; } + for(i = 0; i < stl.count; i++) + myfree(stl.strs[i]); + stl.count = 0; + myfree(hdrs); myfree(body); myfree(mlmmjbounce);
--- a/src/mlmmj-sub.c Tue Jan 18 21:47:42 2005 +1100 +++ b/src/mlmmj-sub.c Wed Jan 19 00:22:44 2005 +1100 @@ -93,7 +93,7 @@ { 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);