From 590677d3d0d7930bb1fd985322ec40b614014559 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Thu, 5 Feb 1998 09:14:25 +0000 Subject: [PATCH] oops, carefule with those splits! git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@510 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/Transaction.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Transaction.c b/src/Transaction.c index 86abac53cb..814aab6a94 100644 --- a/src/Transaction.c +++ b/src/Transaction.c @@ -488,9 +488,11 @@ xaccTransSetMemo (Transaction *trans, const char *memo) /* if there is only one split, then keep memos in sync. */ if (trans->debit_splits) { - if (0x0 == trans->debit_splits[1]) { - free (trans->debit_splits[0]->memo); - trans->debit_splits[0]->memo = strdup (memo); + if (0x0 != trans->debit_splits[0]) { + if (0x0 == trans->debit_splits[1]) { + free (trans->debit_splits[0]->memo); + trans->debit_splits[0]->memo = strdup (memo); + } } } } @@ -503,9 +505,11 @@ xaccTransSetAction (Transaction *trans, const char *actn) /* if there is only one split, then keep action in sync. */ if (trans->debit_splits) { - if (0x0 == trans->debit_splits[1]) { - free (trans->debit_splits[0]->action); - trans->debit_splits[0]->action = strdup (actn); + if (0x0 != trans->debit_splits[0]) { + if (0x0 == trans->debit_splits[1]) { + free (trans->debit_splits[0]->action); + trans->debit_splits[0]->action = strdup (actn); + } } } }