BASIN Data Analysis Engine

FFT.C:

15: Grid * g_k never gets deleted or returned.
18: Function returns without cleaning data
20: fftw_complex variable not freed
52: Function returns without clearing data
78: Function returns without clearing data
81: Function returns without clearing data
111: Geometry geometry_k is not deleted, but copied in Grid constructor
115: Function returns without clearing data
193: cdata not freed
165: get_attribute returns a genvector
179: Function returns without clearing data
196: Function returns without clearing data

List_statistics.C:

WARNING: 28: This is not a memory leak, but also not a good idea
WARNING: 97: if the data for the list needs to be manually deleted (say for an fftw_complex), then the build_data_vector function will return a vector that needs to be deleted.

101: double *w2 is allocated and not deleted.

105: Function returns without clearing data

152: double * tempPtr is allocated and not deleted

156: While a vector of aux_vects will normally be deleted, if we are sorting dynamic data (like a fftw_complex), this will cause a memory leak.

213: double * v not deleted

214: double * w may not be deleted

217: Function returns without clearing data

254: Function returns without clearing data

WARNING: 254: Graphics_List copy constructor will be called here. Though it does not cause a memory leak, Graphics_List does not have a copy constructor.

Region_input.C

221: Function returns without clearing data

224: Function returns without clearing data

258: Function returns without clearing data

261: Function returns without clearing data

283: Function returns without clearing data

286: Function returns without clearing data

291: Function returns without clearing data

294: Function returns without clearing data

299: Function returns without clearing data

301: Function returns without clearing data

455: Function returns without clearing data

636: Function returns without clearing data

653: Function returns without clearing data

733: Function returns without clearing data

749: Function returns without clearing data

Compute_density.C

78: float * min_arr not deleted

79: float * min_arr not deleted

287: int * index is not deleted

289: float * w is not deleted

392: densVec is not deleted

420: Function returns without clearing data

422: double * d may have more than two elements

Files not reviewed: Sort.C (obsolete).

Filter:

Okay, but may cause memory leak if filtering dynamic data (like fftw_complex).

Event

Okay

Vector3

Okay

Data.h

62: Data destructor needs to be made virtual so Grid and List destructors will be executed.

List.C

265: double * test 1 and test 2 is called with get_attribute_element, which when traced goes to a ba_get, which copies data. Test1 and test2 need to be deleted.

268: Function returns without clearing data

272: Function returns without clearing data

276: Function returns without clearing data

Grid.C

Okay

Region.C

295: Region destructor does not destroy children regions (myChildren), or contained lists (listArray) or grids (gridArray). Destructor should also remove itself from its parent.

Geometry.C

Okay

BA.C

746: fill_vect is allocated and not deleted (ba_put copies).

923: T* vals not deleted.

Genvector.h

68: free is used when delete should be.

Partvector.h

412: T * temp is allocated and not deleted.

463: HUGE GAPING MEMORY LEAK-> The + T operator for the Basin

Array does the following (as it should):
create new basin array
make the new array the size of the array adding to
add T to the new array
return the new Array
The partvector code does:
ba<T>* newData = toReturn.get_data_pointer();

*newData = *newData+y;

So, when *newData + y is called, a copy of newData is added to y, and returned to newData. Since newData is a pointer to memory, the old copy of newData is never deleted.

This occurs again on the following lines:

469:

475:

481:

487:

493:

499:

505:

511:

519:

526:

533:

540:

547:

554:

561:

568:

575:

583:

590:

597:

604:

611:

618:

625:

532:

640:

650:

Vector2:

Okay

Graphics_out.C

79: newArr allocated and not free (NOTE: add_data COPIES)

83: newArr allocated and not free (NOTE: add_data COPIES)

95:newArr, newArr2, newArr3 allocated and not free (NOTE: add_data COPIES)

104: newArr, newArr2 allocated and not free (NOTE: add_data COPIES)

106: Function exits without clearing data (newArr).

168: Function returns without clearing data (newVal)

325: newArr allocated and not free (NOTE: add_data COPIES)

329: newArr allocated and not free (NOTE: add_data COPIES)

341:newArr, newArr2, newArr3 allocated and not free (NOTE: add_data COPIES)

350: newArr, newArr2 allocated and not free (NOTE: add_data COPIES)

352: Function exits without clearing data (newArr).

Graphics_outc.C

156: Function returns without clearing data (newVal)

Drexel University	Page 5	October t, jjjj

1995-11-21T17:41:00