]> git.donarmstrong.com Git - samtools.git/commitdiff
fixed a memory leak
authorHeng Li <lh3@live.co.uk>
Mon, 2 Aug 2010 21:31:33 +0000 (21:31 +0000)
committerHeng Li <lh3@live.co.uk>
Mon, 2 Aug 2010 21:31:33 +0000 (21:31 +0000)
bcf.c

diff --git a/bcf.c b/bcf.c
index 8bd222d903e9e66e4fad6b7ca568b70f220fffe4..9d50a573178f2b95aa9562537f88e03c3a960078 100644 (file)
--- a/bcf.c
+++ b/bcf.c
@@ -146,7 +146,7 @@ int bcf_sync(int n_smpl, bcf1_t *b)
                } else if (b->gi[i].fmt == char2int("GL")) {
                        b->gi[i].len = 4;
                }
-               b->gi[i].data = malloc(n_smpl * b->gi[i].len);
+               b->gi[i].data = realloc(b->gi[i].data, n_smpl * b->gi[i].len);
        }
        return 0;
 }