From: Jürg Billeter Date: Wed, 6 Oct 2010 22:07:20 +0000 (+0200) Subject: codegen: Fix double free with GValue boxing X-Git-Tag: 0.11.1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec58ed2ad3e5f5d5306bc8831015c8ba2a67e1c7;p=thirdparty%2Fvala.git codegen: Fix double free with GValue boxing Fixes bug 631356. --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 24c4dee90..71368d8e2 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -4934,7 +4934,8 @@ public class Vala.CCodeBaseModule : CodeGenerator { && expression_type.data_type != gvariant_type); if (expression_type.value_owned - && (target_type == null || !target_type.value_owned || boxing || unboxing)) { + && (target_type == null || !target_type.value_owned || boxing || unboxing) + && !gvalue_boxing /* gvalue can assume ownership of value, no need to free it */) { // value leaked, destroy it var pointer_type = target_type as PointerType; if (pointer_type != null && !(pointer_type.base_type is VoidType)) {