summaryrefslogtreecommitdiff
path: root/src/shared/memfd.c
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2014-08-19 22:08:54 +0200
committerDaniel Mack <zonque@gmail.com>2014-08-19 22:08:54 +0200
commitea47ff669723739e62a9bce6599b0346e464c08f (patch)
tree2c39232a76a045156f597c71b4ba9ad8f5b44499 /src/shared/memfd.c
parent3cd761e4df278cdef6fda9d7f50be512d3c1d7ae (diff)
memfd: skip utf-8 escaping if we use a name that was passed in
If a name was passed in as function argument, trust it, and don't do utf-8 encoding for them. Callers are obliged to check the names themselves, and escape them in case they use anything they got from the outside world.
Diffstat (limited to 'src/shared/memfd.c')
-rw-r--r--src/shared/memfd.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/shared/memfd.c b/src/shared/memfd.c
index e335c0c18b..c21642f49a 100644
--- a/src/shared/memfd.c
+++ b/src/shared/memfd.c
@@ -54,13 +54,7 @@ int memfd_new(const char *name) {
if (isempty(pr))
name = "sd";
else {
- _cleanup_free_ char *e = NULL;
-
- e = utf8_escape_invalid(pr);
- if (!e)
- return -ENOMEM;
-
- g = strappend("sd-", e);
+ g = strappend("sd-", pr);
if (!g)
return -ENOMEM;