simfs: Fix leaking of the voicecall context

When we're shutting down all atoms are removed and the voicecall context
does not have a chance to be freed.  Make sure simfs frees it.
This commit is contained in:
Denis Kenzior 2011-02-10 00:26:15 -06:00
parent fb7e6652d2
commit 50c3d98ff3
1 changed files with 9 additions and 2 deletions

View File

@ -107,8 +107,15 @@ void sim_fs_free(struct sim_fs *fs)
g_queue_free(fs->op_q);
}
if (fs->contexts != NULL)
ofono_error("Freeing simfs, but contexs is not NULL");
if (fs->contexts != NULL) {
GSList *l;
for (l = fs->contexts; l; l = l->next) {
struct ofono_sim_context *context = l->data;
sim_fs_context_free(context);
}
}
g_free(fs);
}