After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674201 - Implicit Variant conversions cause leaks
Implicit Variant conversions cause leaks
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
0.16.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-16 13:33 UTC by Michal Hruby
Modified: 2012-06-02 15:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michal Hruby 2012-04-16 13:33:47 UTC
As can be seen in a simple snippet:

string get_owned_string ()
{
  return "foo";
}

Variant v = get_owned_string ();

The string returned by get_owned_string() is never freed, if one uses:

string s = get_owned_string ();
Variant v = s;

The string is properly freed. (can be reproduced with 0.12, 0.14 and 0.16)
Comment 1 Michal Hruby 2012-05-31 17:21:23 UTC
Same leak when using:

process_unowned_string ((string) string_variant);
Comment 2 Jürg Billeter 2012-06-02 15:07:38 UTC
commit 1b9d1aa6f7abeacb13ac8fa97bb8e7ede453aec1
Author: Jürg Billeter <j@bitron.ch>
Date:   Sat Jun 2 17:03:40 2012 +0200

    GVariant: Fix memory leak when boxing and unboxing variants
    
    Fixes bug 674201.