]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
nsenter: add missing free()
authorKarel Zak <kzak@redhat.com>
Mon, 10 Jul 2023 11:38:11 +0000 (13:38 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Jul 2023 11:38:27 +0000 (13:38 +0200)
Addresses: https://github.com/util-linux/util-linux/pull/2320
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/nsenter.c

index cdbdb482f7e5a54baa03d6009b124414c906329a..1c83e35c17010ac6235764758dab0475059581cc 100644 (file)
@@ -224,8 +224,11 @@ static void open_cgroup_procs(void)
        path++;
 
        snprintf(fdpath, sizeof(fdpath), _PATH_SYS_CGROUP "/%s/cgroup.procs", path);
+
        if ((cgroup_procs_fd = open(fdpath, O_WRONLY | O_APPEND)) < 0)
                err(EXIT_FAILURE, _("failed to open cgroup.procs"));
+
+       free(buf);
 }
 
 static int is_cgroup2(void)