diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-02 09:16:47 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-30 20:43:25 +0100 |
commit | 294bd454701bcb41012466c8a54d8df12357e611 (patch) | |
tree | 89d8c3b12cfc39ec72474ed7162516684ba3949d /src/veritysetup/veritysetup.c | |
parent | 40fd52f28d464d357376d8c641f5a80fdbda59a3 (diff) | |
download | systemd-294bd454701bcb41012466c8a54d8df12357e611.tar.gz |
util-lib: add cleanup function for crypt_free
Diffstat (limited to 'src/veritysetup/veritysetup.c')
-rw-r--r-- | src/veritysetup/veritysetup.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/veritysetup/veritysetup.c b/src/veritysetup/veritysetup.c index 18554aa231..2376f1dc2c 100644 --- a/src/veritysetup/veritysetup.c +++ b/src/veritysetup/veritysetup.c @@ -18,10 +18,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <libcryptsetup.h> #include <stdio.h> #include <sys/stat.h> +#include "crypt-util.h" #include "log.h" #include "hexdecoct.h" #include "string-util.h" @@ -46,7 +46,7 @@ static void log_glue(int level, const char *msg, void *usrptr) { } int main(int argc, char *argv[]) { - struct crypt_device *cd = NULL; + _cleanup_(crypt_freep) struct crypt_device *cd = NULL; int r; if (argc <= 1) { @@ -144,9 +144,6 @@ int main(int argc, char *argv[]) { r = 0; finish: - if (cd) - crypt_free(cd); - free(arg_root_hash); free(arg_data_what); free(arg_hash_what); |