b66cc3a556c36eea0a6575b1a84a8525c7d117d4
braney
  Wed Apr 20 15:19:15 2022 -0700
clone a string that some code decides to free

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 0785c88..a776e2f 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -196,31 +196,31 @@
 
 char *hgOfficialChromName(char *db, char *name)
 /* Returns "canonical" name of chromosome or NULL
  * if not a chromosome. (Case-insensitive search w/sameWord()) */
 {
 if (strlen(name) > HDB_MAX_CHROM_STRING)
     return NULL;
 struct chromInfo *ci = NULL;
 char buf[HDB_MAX_CHROM_STRING];
 strncpy(buf, name, HDB_MAX_CHROM_STRING);
 buf[HDB_MAX_CHROM_STRING-1] = 0;
 ci = hGetChromInfo(db, buf);
 if (ci != NULL)
     return cloneString(ci->chrom);
 
-return chromAliasFindNative(name);
+return cloneString(chromAliasFindNative(name));
 }	/*	char *hgOfficialChromName(char *db, char *name)	*/
 
 boolean hgIsOfficialChromName(char *db, char *name)
 /* Determine if name is exact (case-sensitive) match with
  * a chromosome in the given assembly */
 {
 char *chrom;
 return ((chrom = hgOfficialChromName(db, name)) != NULL &&
 	sameString(name, chrom));
 }
 
 static boolean minLen = 0;
 
 void setMinIndexLengthForTrashCleaner()
 /* set the minimum index size so trash cleaner will not die