mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix crash if gnucash-cli --quotes is passed a bad database name.
cleanup_and_exit_with_failure doesn't exit anymore so we need to return its error value instead of trying to keep using the freed session.
This commit is contained in:
parent
efb24f090d
commit
bc1f5b80c1
@ -342,11 +342,11 @@ Gnucash::add_quotes (const bo_str& uri)
|
||||
|
||||
qof_session_begin(session, uri->c_str(), SESSION_NORMAL_OPEN);
|
||||
if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
|
||||
cleanup_and_exit_with_failure (session);
|
||||
return cleanup_and_exit_with_failure (session);
|
||||
|
||||
qof_session_load(session, NULL);
|
||||
if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
|
||||
cleanup_and_exit_with_failure (session);
|
||||
return cleanup_and_exit_with_failure (session);
|
||||
|
||||
try
|
||||
{
|
||||
@ -365,7 +365,7 @@ Gnucash::add_quotes (const bo_str& uri)
|
||||
}
|
||||
qof_session_save(session, NULL);
|
||||
if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
|
||||
cleanup_and_exit_with_failure (session);
|
||||
return cleanup_and_exit_with_failure (session);
|
||||
|
||||
qof_session_destroy(session);
|
||||
qof_event_resume();
|
||||
|
Loading…
Reference in New Issue
Block a user