]> git.ipfire.org Git - people/ms/dma.git/commitdiff
dma: initialize queue structures
authorSimon Schubert <corecode@dragonflybsd.org>
Thu, 27 Aug 2009 14:38:51 +0000 (16:38 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Thu, 27 Aug 2009 21:12:37 +0000 (23:12 +0200)
dma.c
mail.c
spool.c

diff --git a/dma.c b/dma.c
index bf22e8ef44d5baf71c8c14e09352729b27fbcd66..d1f2493abeb21968d54ea417d1baed740e4d3ced 100644 (file)
--- a/dma.c
+++ b/dma.c
@@ -345,11 +345,12 @@ main(int argc, char **argv)
 {
        char *sender = NULL;
        struct queue queue;
-       struct queue lqueue;
        int i, ch;
        int nodot = 0, doqueue = 0, showq = 0;
 
        atexit(deltmp);
+
+       bzero(&queue, sizeof(queue));
        LIST_INIT(&queue.queue);
 
        if (strcmp(argv[0], "mailq") == 0) {
@@ -465,16 +466,16 @@ skipopts:
                errlog(1, "can not read SMTP authentication file");
 
        if (showq) {
-               if (load_queue(&lqueue) < 0)
+               if (load_queue(&queue) < 0)
                        errlog(1, "can not load queue");
-               show_queue(&lqueue);
+               show_queue(&queue);
                return (0);
        }
 
        if (doqueue) {
-               if (load_queue(&lqueue) < 0)
+               if (load_queue(&queue) < 0)
                        errlog(1, "can not load queue");
-               run_queue(&lqueue);
+               run_queue(&queue);
                return (0);
        }
 
diff --git a/mail.c b/mail.c
index d11f46590cf4d9598ac98e00ecbdc15fb36b7f2c..7f826b20f0014921ee9411200eebc1e82c9c5ab5 100644 (file)
--- a/mail.c
+++ b/mail.c
@@ -52,6 +52,7 @@ bounce(struct qitem *it, const char *reason)
                exit(1);
        }
 
+       bzero(&bounceq, sizeof(bounceq));
        LIST_INIT(&bounceq.queue);
        if (add_recp(&bounceq, it->sender, "", 1) != 0)
                goto fail;
diff --git a/spool.c b/spool.c
index 33e972d5082b7f7f9e8cee50b62e8421fc535fa6..7988a1f1afd41c5dc88a66a494479c099e161955 100644 (file)
--- a/spool.c
+++ b/spool.c
@@ -200,6 +200,7 @@ load_queue(struct queue *queue)
        char *mailfn;
        off_t hdrlen;
 
+       bzero(queue, sizeof(queue));
        LIST_INIT(&queue->queue);
 
        spooldir = opendir(config->spooldir);