primaryodors / primarydock

PrimaryOdors.org molecular docker.
Other
6 stars 3 forks source link

Stack, rather than heap, return value pointers. #295

Open primaryodors opened 1 year ago

primaryodors commented 1 year ago

Functions that allocate memory with new() and then return the resulting pointer should be modified to instead keep a global array in memory, populate that array with the function results, and then set it as the return value. This will decrease the potential for segmentation faults, memory leaks, and (hopefully) false positive errors in valgrind.