Unverified Commit 1d5f3222 by Christian Brauner Committed by GitHub

Merge pull request #3264 from tych0/fix-leak

lxclock: fix a small memory leak
parents a5ee97e6 b8a6a00c
......@@ -169,6 +169,8 @@ struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name)
l->type = LXC_LOCK_FLOCK;
l->u.f.fname = lxclock_name(lxcpath, name);
if (!l->u.f.fname) {
if (!name)
free(l->u.sem);
free(l);
l = NULL;
goto on_error;
......
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