Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: "Freed pointer was not allocated error"
- close #356 - given that `SW_SoilWat->hist.file_prefix` is not initialized when `SW_SWC_construct()` is called (by SOILWAT2), then `!isnull(SW_SoilWat->hist.file_prefix)` was TRUE and we freed the not allocated pointer. -> now, initialize instead of free the pointer -> NOTE: rSOILWAT2 may now have a memory leak if it calls this function with a previously allocated `file_prefix` (e.g., if a `sw_exec()` fails and doesn't properly clean up).
- Loading branch information