2f5a612456a812e04baf2b33a3b222f6c6be4275 angie Wed Jun 10 16:29:07 2015 -0700 Adding a couple cloneString calls that I think are necessary; consider what may happen to wi->file, esp w/"freeMem(currentFile)". diff --git src/hg/hgTracks/wigTrack.c src/hg/hgTracks/wigTrack.c index 106f174..ce38aad 100644 --- src/hg/hgTracks/wigTrack.c +++ src/hg/hgTracks/wigTrack.c @@ -1343,39 +1343,39 @@ /* Now that we know what Span to draw, see if this item should be * drawn at all. */ if (usingDataSpan == wi->span) { /* Check our data file, see if we need to open a new one */ if (differentStringNullOk(currentFile,"")) { if (differentStringNullOk(currentFile,wi->file)) { if (wibFH > 0) { udcFileClose(&wibFH); freeMem(currentFile); } - currentFile = wi->file; + currentFile = cloneString(wi->file); wibFH = udcFileMayOpen(hReplaceGbdb(currentFile), NULL); if (wibFH==NULL) errAbort("hgTracks/wigLoadPreDraw: failed to open wiggle %s", currentFile); } } else { - currentFile = wi->file; + currentFile = cloneString(wi->file); wibFH = udcFileMayOpen(hReplaceGbdb(currentFile), NULL); if (wibFH==NULL) errAbort("hgTracks/wigLoadPreDraw: failed to open wiggle %s", currentFile); } /* Ready to draw, what do we know: * the feature being processed: * chrom coords: [wi->start : wi-end) * * The data to be drawn: to be read from file f at offset wi->Offset * data points available: wi->Count, representing wi->Span bases * for each data point * * The drawing window, in pixels: * xOff = left margin, yOff = top margin, h = height of drawing window * drawing window in chrom coords: seqStart, seqEnd