summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-01-21 20:01:38 +0100
committerLennart Poettering <lennart@poettering.net>2019-01-23 23:37:17 +0100
commitd135419e3276c71824bfa97a60826cd9cd367797 (patch)
tree5d8657c3a4371714e1b43e1c42aaa403a77a47a8
parentMerge pull request #11536 from yuwata/fix-11529 (diff)
downloadsystemd-d135419e3276c71824bfa97a60826cd9cd367797.tar.xz
systemd-d135419e3276c71824bfa97a60826cd9cd367797.zip
cryptsetup: use free_and_replace() where appropriate
-rw-r--r--src/cryptsetup/cryptsetup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index daf26aad70..49a7307809 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -408,8 +408,7 @@ static int get_password(const char *vol, const char *src, usec_t until, bool acc
return log_oom();
strncpy(c, *p, arg_key_size);
- free(*p);
- *p = c;
+ free_and_replace(*p, c);
}
*ret = TAKE_PTR(passwords);