diff --git a/src/engine/AccInfo.c b/src/engine/AccInfo.c index d9d013b9aa..ae75b76e75 100644 --- a/src/engine/AccInfo.c +++ b/src/engine/AccInfo.c @@ -69,6 +69,7 @@ void xaccInitInvAcct (InvAcct *iacc) { if (!iacc) return; + iacc->type = -1; iacc->pricesrc = NULL; iacc->brokerid = NULL; iacc->acctid = NULL; @@ -89,6 +90,7 @@ xaccFreeInvAcct (InvAcct *iacc) if (iacc->prodtype) { free(iacc->prodtype); iacc->prodtype = NULL; } if (iacc->secid) { free(iacc->secid); iacc->secid = NULL; } if (iacc->secidtype) { free(iacc->secidtype); iacc->secidtype = NULL; } + iacc->type = -1; } /* =========================================================== */ diff --git a/src/engine/AccInfoP.h b/src/engine/AccInfoP.h index 6be076c2ef..67fc8d9e95 100644 --- a/src/engine/AccInfoP.h +++ b/src/engine/AccInfoP.h @@ -43,6 +43,7 @@ */ struct _BankAcct { + short type; /* must match Account::type */ char * bankid; /* routing and transit number */ char * branchid; /* branch office bank identifier */ char * acctid; /* account number */ @@ -57,6 +58,7 @@ struct _BankAcct */ struct _InvAcct { + short type; /* must match Account::type */ char * pricesrc; /* source for price quotes ... * one of Yahoo, Fidelity, TRowePrice, etc. */ @@ -74,6 +76,7 @@ struct _InvAcct }; union _AccInfo { + short type; /* must match Account::type */ BankAcct bank_acct; InvAcct inv_acct; }; diff --git a/src/engine/Account.c b/src/engine/Account.c index 8d48c22258..1bd3f64be4 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -84,6 +84,7 @@ xaccInitAccount (Account * acc) acc->flags = 0; acc->type = -1; + acc->accInfo = NULL; acc->accountName = NULL; acc->accountCode = NULL;