[folks] ofono: Work around a Vala bug causing a double-free when adding a modem
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] ofono: Work around a Vala bug causing a double-free when adding a modem
- Date: Tue, 8 Oct 2013 18:31:25 +0000 (UTC)
commit 4107cef64ae54fcd652fa64a6ef5b348fc77f8bc
Author: Philip Withnall <philip withnall collabora co uk>
Date: Tue Oct 8 19:29:38 2013 +0100
ofono: Work around a Vala bug causing a double-free when adding a modem
Work around Vala bug #709665:
https://bugzilla.gnome.org/show_bug.cgi?id=709665
which allowed an assignment of a string*[] value to a string[] variable.
string*[] values need the container freeing, but not the members of the
array. However, since the variable was a string[], Vala generated C code to
free both the container and the members, resulting in a double-free of each
member.
backends/ofono/ofono-backend.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/backends/ofono/ofono-backend.vala b/backends/ofono/ofono-backend.vala
index 1410917..a63d4b4 100644
--- a/backends/ofono/ofono-backend.vala
+++ b/backends/ofono/ofono-backend.vala
@@ -273,8 +273,8 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
if (features_variant != null)
{
string alias = this._modem_alias (properties);
- string[] features = features_variant.get_strv ();
-
+ var features = features_variant.get_strv ();
+
foreach (string feature in features)
{
if (feature == "sim")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]