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

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

alchemy/sem: prevent double-free on error path

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

---

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

diff --git a/lib/alchemy/sem.c b/lib/alchemy/sem.c
index cf4add9..4b967ed 100644
--- a/lib/alchemy/sem.c
+++ b/lib/alchemy/sem.c
@@ -226,7 +226,7 @@ int rt_sem_create(RT_SEM *sem, const char *name,
 
        if (syncluster_addobj(&alchemy_sem_table, scb->name, &scb->cobj)) {
                registry_destroy_file(&scb->fsobj);
-               semobj_destroy(&scb->smobj);
+               semobj_uninit(&scb->smobj);
                xnfree(scb);
                ret = -EEXIST;
        } else


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

Reply via email to