]> git.proxmox.com Git - mirror_lxc.git/blobdiff - hooks/unmount-namespace.c
seccomp: don't ignore syscalls when there's no proxy
[mirror_lxc.git] / hooks / unmount-namespace.c
index 9b4033fbd1fcc1ebc687be3c4108e4b4229cac73..99b284481b33c5ac55a4b43bdcbfda2a997669fb 100644 (file)
@@ -112,14 +112,17 @@ static int read_mounts(int procfd, struct mount **mp, size_t *countp) {
        *countp = 0;
 
        fd = openat(procfd, "self/mounts", O_RDONLY);
-       if (fd < 0)
+       if (fd < 0) {
+               free(mounts);
                return 0;
+       }
 
        mf = fdopen(fd, "r");
        if (!mf) {
                int error = errno;
                close(fd);
                errno = error;
+               free(mounts);
                return 0;
        }
        while ((ent = getmntent(mf))) {