]> git.tue.mpg.de Git - paraslash.git/commitdiff
Fix a couple of memory leaks.
authorAndre Noll <maan@systemlinux.org>
Sat, 6 Feb 2010 23:23:47 +0000 (00:23 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 6 Feb 2010 23:23:47 +0000 (00:23 +0100)
Found by valgrinds memory checker.

dccp_recv.c
fecdec_filter.c
http_recv.c
prebuffer_filter.c
recv.c
recv_common.c
udp_recv.c

index 0b62529f417352715d14304685565f1efeae581d..0fddcfac1d9e69d4e82701c4cede61569b244498 100644 (file)
@@ -47,6 +47,7 @@ static void dccp_recv_close(struct receiver_node *rn)
 
        if (pdd && pdd->fd > 0)
                close(pdd->fd);
+       btr_pool_free(pdd->btrp);
        free(rn->private_data);
        rn->private_data = NULL;
 }
@@ -140,6 +141,7 @@ err:
 static void dccp_recv_free_config(void *conf)
 {
        dccp_recv_cmdline_parser_free(conf);
+       free(conf);
 }
 
 /**
index 8ccc2ee2b344371e369e0c2df5c792616f5d2374..3c0c67bc367d4d766c5b7f8933bdb0349df555f1 100644 (file)
@@ -431,6 +431,7 @@ static void fecdec_close(struct filter_node *fn)
        FOR_EACH_FECDEC_GROUP(fg, pfd)
                clear_group(fg);
        fec_free(pfd->fec);
+       btr_pool_free(pfd->btrp);
        free(fn->private_data);
        fn->private_data = NULL;
 }
index 035d1f1908f9f176689fb5a51501d8b788372c17..bd234a02827c120dfe35b629d04fd8211da5bb3a 100644 (file)
@@ -186,6 +186,7 @@ static int http_recv_open(struct receiver_node *rn)
 static void http_recv_free_config(void *conf)
 {
        http_recv_cmdline_parser_free(conf);
+       free(conf);
 }
 
 /**
index ac66b203c5526d75b52178a47383151d47a8f12d..44ad5af1037500f6ff12641d19ee3bd3fc9bdcda 100644 (file)
@@ -74,7 +74,6 @@ static void prebuffer_post_select(__a_unused struct sched *s, struct task *t)
        if (iqs < conf->size_arg)
                return;
        btr_splice_out_node(btrn);
-       prebuffer_close(fn);
        t->error = -E_PREBUFFER_SUCCESS;
 }
 
diff --git a/recv.c b/recv.c
index 5cd64cc7e6058cd7723c9abf847f36a23c8f0a0b..df1afb3685ff05dea7a9278b47ef9ef7e9a8971f 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -115,7 +115,7 @@ out:
                r->close(&rn);
        btr_free_node(rn.btrn);
        btr_free_node(sot.btrn);
-       free(rn.conf);
+       r->free_config(rn.conf);
        if (ret < 0)
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));
        return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
index bbaf139688ff6ccb0d78284f1bb495e7dd106a86..b496f4e4b823eb02b449289f00c23bc193cac4f7 100644 (file)
@@ -55,7 +55,7 @@ static void *parse_receiver_args(int receiver_num, char *options)
        }
        argv[0] = make_message("%s_recv", r->name);
        conf = r->parse_config(argc, argv);
-       for (i = 1; i < argc; i++)
+       for (i = 0; i < argc; i++)
                free(argv[i]);
        free(argv);
        return conf;
index 2657beec952059a58cac468f02d0dc2d3350777c..d899e43933eddc9c72de93354ada14c3a607012a 100644 (file)
@@ -209,6 +209,7 @@ err:
 static void udp_recv_free_config(void *conf)
 {
        udp_recv_cmdline_parser_free(conf);
+       free(conf);
 }
 
 /**