mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gnc-date.cpp] don't alloc tm* unless GncDateTime() succeeds
because GncDateTime() may throw an exception, in which case time will leak. mainly leaks in test suite.
This commit is contained in:
parent
5a03d9798c
commit
a8dffb8559
@ -187,8 +187,8 @@ gnc_gmtime (const time64 *secs)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
|
||||
GncDateTime gncdt(*secs);
|
||||
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
|
||||
*time = gncdt.utc_tm();
|
||||
return time;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user