From a808525d05f615ce9c9b2810c618cfe4bf7bda7f Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 27 Oct 2016 16:25:56 -0700 Subject: [PATCH] Fix free of non-malloced memory crash in SQL save slots. --- src/backend/sql/gnc-slots-sql.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/sql/gnc-slots-sql.cpp b/src/backend/sql/gnc-slots-sql.cpp index 56febc9b49..5feafe231c 100644 --- a/src/backend/sql/gnc-slots-sql.cpp +++ b/src/backend/sql/gnc-slots-sql.cpp @@ -665,10 +665,10 @@ save_slot (const gchar* key, KvpValue* value, gpointer data) break; case KvpValue::Type::GLIST: { - GncGUID guid = guid_new_return (); - slot_info_t* pNewInfo = slot_info_copy (pSlot_info, &guid); + GncGUID* guid = guid_new (); + slot_info_t* pNewInfo = slot_info_copy (pSlot_info, guid); KvpValue* oldValue = pSlot_info->pKvpValue; - pSlot_info->pKvpValue = new KvpValue {&guid}; + pSlot_info->pKvpValue = new KvpValue {guid}; // Transfer ownership! pSlot_info->is_ok = gnc_sql_do_db_operation (pSlot_info->be, OP_DB_INSERT, TABLE_NAME, TABLE_NAME, pSlot_info,