ecb1f5ac7ce97b744bd3c1b1f4f79652951fd20f
braney
  Thu Mar 7 14:31:36 2024 -0800
don't free mem in hash code that wasn't allocated from the heap in the first place

diff --git src/lib/hash.c src/lib/hash.c
index a8762c6..c65f836 100644
--- src/lib/hash.c
+++ src/lib/hash.c
@@ -448,31 +448,31 @@
 int i;
 struct hashEl *hel, *next;
 for (i=0; i<oldHashSize; ++i)
     {
     for (hel = oldTable[i]; hel != NULL; hel = next)
 	{
 	next = hel->next;
 	int hashVal = hel->hashVal & hash->mask;
 	hel->next = hash->table[hashVal];
 	hash->table[hashVal] = hel;
 	}
     }
 /* restore original list order */
 hashReverseAllBucketLists(hash);
 
-if (!hash->lm)
+if (! ((hash->lm != NULL) || hash->ownLm))
     freeMem(oldTable);
 hash->numResizes++;
 }
 
 struct slName *hashSlNameFromHash(struct hash *hash)
 /* Create a slName list from the names in a hash. */
 {
 struct slName *list = NULL;
 struct hashCookie cookie = hashFirst(hash);
 struct hashEl *hel;
 while ((hel = hashNext(&cookie)) != NULL)
     {
     struct slName *one = newSlName(hel->name);
     slAddHead(&list, one);
     }