]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/path: avoid double free() for cpusets master
authorKarel Zak <kzak@redhat.com>
Wed, 2 Jul 2025 10:25:45 +0000 (12:25 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Jul 2025 10:25:45 +0000 (12:25 +0200)
Addresses: https://github.com/util-linux/util-linux/issues/3641
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/path.c

index 48324d6dc8958a00713fa96e9b20746d54485aad..a828aea493c05c207331e4489e2f8da788bcc678 100644 (file)
@@ -1057,8 +1057,10 @@ static int ul_path_cpuparse(struct path_cxt *pc, cpu_set_t **set, int maxcpus, i
        rc = 0;
 
 out:
-       if (rc)
+       if (rc) {
                cpuset_free(*set);
+               *set = NULL;
+       }
        free(buf);
        return rc;
 }