d0942d5563ca2fdd0170c4730bb6bf1ecc8258ea
braney
  Thu Aug 27 09:16:16 2026 -0700
quickLift: take out the unused visibility string, refs #38032

trackHubBuild and walkTree never wrote visDy.  hgConvert allocated it, passed it
down, then reassigned it inside the chain loop, leaking a dyString per chain.

diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c
index a37ea145888..5efc8689c61 100644
--- src/hg/lib/trackHub.c
+++ src/hg/lib/trackHub.c
@@ -2012,31 +2012,31 @@
 {
 char *cartVis = cartOptionalString(cart, tdb->track);
 if (cartVis != NULL)
     tdb->visibility = hTvFromString(cartVis);
 return (tdb->visibility != tvHide);
 }
 
 static boolean isFromQuickLiftHub(struct trackDb *tdb)
 /* True if this tdb came from a quickLift hub (already a lifted shadow track).
  * Such tracks must not be lifted again. */
 {
 return trackDbSetting(tdb, "quickLiftUrl") != NULL ||
        trackDbSetting(tdb, "quickLifted") != NULL;
 }
 
-static void walkTree(FILE *f, char *db, struct cart *cart,  struct trackDb *tdb, struct dyString *visDy, struct trackDb **badList, struct hash *existingTracks)
+static void walkTree(FILE *f, char *db, struct cart *cart,  struct trackDb *tdb, struct trackDb **badList, struct hash *existingTracks)
 /* walk tree looking for visible tracks to output to hub.  Skip tracks that already
  * came from a quickLift hub, and skip tracks whose name is already present in
  * the existing hub file. */
 {
 struct hash *haveSuper = newHash(0);
 struct trackDb *tdbNext = NULL;
 
 // The priority written to the hub is the track's rank in the source list, which the
 // caller has sorted on group priority and then track priority.  The rank has to count
 // every track we walk past, not just the ones we output: the hub file is appended to
 // across requests, so the number a track gets must depend only on how the source is
 // laid out, never on which request it happened to be added in.
 //
 // The source priority itself will not do.  All lifted tracks land in one group on the
 // target (trackHubAddGroupName rewrites the group of every hub track), so a priority
@@ -2126,31 +2126,31 @@
 const struct trackDb *b = *((struct trackDb **)vb);
 float dif = 0;
 
 dif = a->groupPriority - b->groupPriority;
 if (dif == 0)
     dif = a->priority - b->priority;
 if (dif < 0)
    return -1;
 else if (dif == 0.0)
     /* secondary sort on label */
     return strcasecmp(a->shortLabel, b->shortLabel);
 else
    return 1;
 }
 
-char *trackHubBuild(char *db, struct cart *cart, struct dyString *visDy, struct trackDb **badList)
+char *trackHubBuild(char *db, struct cart *cart, struct trackDb **badList)
 /* Build a track hub using trackDb and the cart.  If a hub file already exists
  * for db (i.e. earlier quickLift work in the same session), append new track
  * stanzas to it instead of overwriting, and skip tracks that are already in
  * the file. */
 {
 struct  trackDb *tdbList, *tdb;
 struct grp *grpList;
 cartTrackDbInit(cart, &tdbList, &grpList, FALSE);
 
 struct hash *groupHash = newHash(0);
 struct grp *grp;
 for(grp = grpList; grp; grp = grp->next)
     hashAdd(groupHash, grp->name, grp);
 
 for(tdb = tdbList; tdb; tdb = tdb->next)
@@ -2159,31 +2159,31 @@
     tdb->groupPriority = grp->priority;
     }
 slSort(&tdbList, cmpPriority);
 
 char *filename = getHubName(cart, db);
 
 struct hash *existingTracks = newHash(8);
 readExistingHubTracks(filename, existingTracks);
 boolean hubExists = (hashNumEntries(existingTracks) > 0);
 
 FILE *f = mustOpen(filename, hubExists ? "a" : "w");
 chmod(filename, 0666);
 if (!hubExists)
     outHubHeader(f, trackHubSkipHubName(db));
 
-walkTree(f, db, cart, tdbList, visDy, badList, existingTracks);
+walkTree(f, db, cart, tdbList, badList, existingTracks);
 fclose(f);
 
 return cloneString(filename);
 }
 
 struct grp *trackHubGetGrps()
 /* Get the groups defined by attached track hubs. */
 {
 return trackHubGrps;
 }
 
 struct trackDb *trackHubAddTracksGenome(struct trackHubGenome *hubGenome)
 /* Load up stuff from data hub and return list. */
 {
 /* Load trackDb.ra file and make it into proper trackDb tree */