Commit ac6fb1c0 authored by Philippe Gerum's avatar Philippe Gerum

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.
parent 9e3cbdb1
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment