From 67069ff6a6228ed8170f024e2d7c3c14e70f7253 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Tue, 17 Sep 2019 21:54:46 +0200 Subject: [PATCH] [aqbanking] Fix non-const return argument in aqbanking6 that we must free ourselves. --- gnucash/import-export/aqb/gnc-ab-utils.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c index addad80037..67a5d58c5a 100644 --- a/gnucash/import-export/aqb/gnc-ab-utils.c +++ b/gnucash/import-export/aqb/gnc-ab-utils.c @@ -382,8 +382,10 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx) # if AQBANKING_VERSION_INT < 59929 # error "You are using an old beta version of aqbanking > 5.99.0 but < 5.99.29, please upgrade to the latest 5.99.29 or newer." # endif +#else + const /* only const in aqbanking < 5.99 */ #endif - const GWEN_STRINGLIST *ab_purpose; + GWEN_STRINGLIST *ab_purpose; const char *ab_transactionText = NULL; gchar *gnc_description = NULL; @@ -411,6 +413,11 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx) GWEN_StringList_ForEach(ab_purpose, join_ab_strings_cb, &gnc_description); +#ifdef AQBANKING6 + /* With aqbanking>=5.99, the return value must now be free'd */ + GWEN_StringList_free(ab_purpose); +#endif + if (!gnc_description) gnc_description = g_strdup("");