aboutsummaryrefslogtreecommitdiffstats
path: root/libmount/src/utils.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2024-01-08 10:32:54 +0100
committerKarel Zak <kzak@redhat.com>2024-01-08 10:32:54 +0100
commita002df07ac15c370381cb44f06afeaa333685780 (patch)
treee6976408eeb5231bf20743c02ed41f9cd3ca613c /libmount/src/utils.c
parentc14bee4d44ac8c61d56028f2f032e35c32533c38 (diff)
downloadutil-linux-a002df07ac15c370381cb44f06afeaa333685780.tar.gz
libmount: don't assume errno after failed asprintf()
Reported-by: Thomas Weißschuh <thomas@t-8ch.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/utils.c')
-rw-r--r--libmount/src/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index f301f3f567..a2f8ea0337 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -1032,7 +1032,7 @@ int mnt_open_uniq_filename(const char *filename, char **name)
rc = asprintf(&n, "%s.XXXXXX", filename);
if (rc <= 0)
- return -errno;
+ return -ENOMEM;
/* This is for very old glibc and for compatibility with Posix, which says
* nothing about mkstemp() mode. All sane glibc use secure mode (0600).