summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-11-16 10:09:48 -0600
committerDenis Kenzior <denkenz@gmail.com>2009-11-16 10:09:48 -0600
commitea29ea9bd5bee840b3bedf55ddc963f177d90d64 (patch)
tree0b690f80bdee0c3d0914d409e1377ddc9b89ec3e
parent83ee938312eea013ab8ae35f6b43ddde62d022dd (diff)
downloadofono-ea29ea9bd5bee840b3bedf55ddc963f177d90d64.tar.bz2
Fix: Set current element properly
When removing an element from the list, the current iterator was not being updated properly. Most likely leading to double free.
-rw-r--r--drivers/hfpmodem/voicecall.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index a132243a..f0445520 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -161,6 +161,7 @@ static void release_with_status(struct ofono_voicecall *vc, int status)
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
GSList *p = NULL;
GSList *c = vd->calls;
+ GSList *t;
struct ofono_call *call;
while (c) {
@@ -179,7 +180,9 @@ static void release_with_status(struct ofono_voicecall *vc, int status)
else
vd->calls = c->next;
- g_slist_free_1(c);
+ t = c;
+ c = c->next;
+ g_slist_free_1(t);
}
}