071f5846776ec79a7bd4589f826adfcc20e3a444
chmalee
  Fri Aug 6 12:46:53 2021 -0700
Fixing unitialized variable, refs #15554, #27942

diff --git src/hg/lib/hgFind.c src/hg/lib/hgFind.c
index 424f138..f3db31c 100644
--- src/hg/lib/hgFind.c
+++ src/hg/lib/hgFind.c
@@ -2861,39 +2861,43 @@
                 pos->chromEnd = helper->chromEnd + padding;
                 pos->name = slNameListToString(helper->validTranscripts, '/');
                 pos->description = cloneString(helper->label);
                 pos->browserName = "";
                 slAddHead(&table->posList, pos);
                 // highlight the mapped bases to distinguish from padding
                 hgp->tableList->posList->highlight = addHighlight(db, helper->chrom,
                                                         helper->chromStart, helper->chromEnd);
                 }
             }
         }
     else
         // all of the positions mapped incorrectly, so the term was bad. However, we may
         // be able to still go to a general area around the term, so build that, warn the
         // user about their bad search term, and warn that this is not an exactly correct position
+        // NOTE: There is a bug here in general, in that when mapping an hgvs term we don't
+        // consider alternate haplotypes, and thus below we will always get at least some range
+        // on the same chromosome within a gene, but if the mapping code were to change in the
+        // future, we might end up with some weird coordinates
         {
         struct hashEl *hel, *helList= hashElListHash(uniqHgvsPos);
         if (hgp->tableList == NULL)
             hgp->tableList = table;
         foundIt = TRUE;
         table->name = helper->table;
         struct hgPos *pos;
         AllocVar(pos);
-        char *chrom;
+        char *chrom = NULL;
         int spanStart = INT_MAX, spanEnd = 0;
         for (hel = helList; hel != NULL; hel = hel->next)
             {
             helper = (struct hgvsHelper *)hel->val;
             chrom = helper->chrom;
             spanStart = helper->chromStart < spanStart ? helper->chromStart : spanStart;
             spanEnd = helper->chromEnd > spanEnd ? helper->chromEnd : spanEnd;
             }
         pos->chrom = cloneString(chrom);
         pos->chromStart = spanStart-padding;
         pos->chromEnd = spanEnd + padding;
         pos->name = "Approximate area";
         pos->description = term;
         pos->browserName = term;
         slAddHead(&table->posList, pos);