src/hg/lib/liftOver.c 1.47

1.47 2009/09/17 21:25:09 hiram
Properly free the second subChain
Index: src/hg/lib/liftOver.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/liftOver.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -b -B -U 4 -r1.46 -r1.47
--- src/hg/lib/liftOver.c	17 Sep 2009 21:16:20 -0000	1.46
+++ src/hg/lib/liftOver.c	17 Sep 2009 21:25:09 -0000	1.47
@@ -208,9 +208,8 @@
 for (chain = chainsHit; chain != NULL; chain = next)
     {
     struct chain *subChain = NULL;
     struct chain *toFree = NULL;
-    struct chain *toFree2 = NULL;
     int start=s, end=e;
     next = chain->next;
     verbose(3,"hit chain %s:%d %s:%d-%d %c (%d)\n",
         chain->tName, chain->tStart,  chain->qName, chain->qStart, chain->qEnd,
@@ -238,10 +237,12 @@
     if (chain->qStrand == '-')
 	strand = otherStrand(strand);
     if (useThick)
 	{
+	struct chain *subChain2 = NULL;
+	struct chain *toFree2 = NULL;
 	if (!mapThroughChain(chain, minRatio, &thickStart, &thickEnd,
-		&subChain, &toFree2))
+		&subChain2, &toFree2))
 	    thickStart = thickEnd = start;
 	chainFree(&toFree2);
 	}
     verbose(3, "mapped %s:%d-%d\n", chain->qName, start, end);