mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 798545 - Crash when updating document link on vendor bill
There were two issues here, the first one was that the copied doclink was pointing to the original doclink which lead to a double-free. The second is the setting of the doclink on the copied invoice needs to be done with gncInvoiceSetDocLink otherwise on closure the doclink value will disappear.
This commit is contained in:
parent
80f1101447
commit
59d95a4ce6
@ -379,7 +379,10 @@ GncInvoice *gncInvoiceCopy (const GncInvoice *from)
|
||||
// Oops. Do not forget to copy the pointer to the correct currency here.
|
||||
invoice->currency = from->currency;
|
||||
|
||||
invoice->doclink = from->doclink;
|
||||
if (from->doclink == is_unset)
|
||||
invoice->doclink = (char*)is_unset;
|
||||
else
|
||||
gncInvoiceSetDocLink (invoice, from->doclink);
|
||||
|
||||
// Copy all invoice->entries
|
||||
for (node = from->entries; node; node = node->next)
|
||||
|
Loading…
Reference in New Issue
Block a user