lxclock: cleanup lxc_putlock()

parent 42356060
...@@ -264,24 +264,16 @@ void lxc_putlock(struct lxc_lock *l) ...@@ -264,24 +264,16 @@ void lxc_putlock(struct lxc_lock *l)
if (!l) if (!l)
return; return;
switch(l->type) { switch (l->type) {
case LXC_LOCK_ANON_SEM: case LXC_LOCK_ANON_SEM:
if (l->u.sem) { if (l->u.sem) {
sem_destroy(l->u.sem); sem_destroy(l->u.sem);
free(l->u.sem); free_disarm(l->u.sem);
l->u.sem = NULL;
} }
break; break;
case LXC_LOCK_FLOCK: case LXC_LOCK_FLOCK:
if (l->u.f.fd >= 0) { close_prot_errno_disarm(l->u.f.fd);
close(l->u.f.fd); free_disarm(l->u.f.fname);
l->u.f.fd = -1;
}
free(l->u.f.fname);
l->u.f.fname = NULL;
break; break;
} }
......
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