Index: src/hg/hgTables/maf.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/maf.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -b -B -U 4 -r1.17 -r1.18
--- src/hg/hgTables/maf.c	20 May 2009 20:59:56 -0000	1.17
+++ src/hg/hgTables/maf.c	4 Jan 2010 19:12:22 -0000	1.18
@@ -31,18 +31,21 @@
         return TRUE;
     }
 else
     {
-    struct trackDb *childTdb;
-    for (childTdb = track->subtracks;childTdb;childTdb=childTdb->next)
+    struct slRef *tdbRefList = trackDbListGetRefsToDescendantLeaves(track->subtracks);
+    struct slRef *tdbRef;
+    for (tdbRef = tdbRefList; tdbRef != NULL; tdbRef = tdbRef->next)
         {
+	struct trackDb *childTdb = tdbRef->val;
         if(sameString(childTdb->tableName, table))
             {
             if (startsWithWord("maf",childTdb->type) || startsWithWord("wigMaf",childTdb->type))
                 return TRUE;
             break;
             }
         }
+    slFreeList(&tdbRefList);
     }
 return FALSE;
 }
 

