Module: xenomai-3
Branch: next
Commit: 9e3cbdb1647d3d0cf552303f3c7960e2cc178ca8
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9e3cbdb1647d3d0cf552303f3c7960e2cc178ca8

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Aug 10 18:08:00 2015 +0200

alchemy/event: prevent double-free on error path

We don't want the finalizer to run for the underlying event object
when cleaning up upon error at creation. Call the uninit helper
instead.

---

 lib/alchemy/event.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/alchemy/event.c b/lib/alchemy/event.c
index 0f83376..dd260f5 100644
--- a/lib/alchemy/event.c
+++ b/lib/alchemy/event.c
@@ -215,7 +215,7 @@ int rt_event_create(RT_EVENT *event, const char *name,
 
        if (syncluster_addobj(&alchemy_event_table, evcb->name, &evcb->cobj)) {
                registry_destroy_file(&evcb->fsobj);
-               eventobj_destroy(&evcb->evobj);
+               eventobj_uninit(&evcb->evobj);
                xnfree(evcb);
                ret = -EEXIST;
        } else


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to