diff options
author | Nate Clark <github@neworld.us> | 2017-06-16 16:44:57 -0400 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-06-16 22:44:57 +0200 |
commit | a1bb2402cb6edc4b46f6bf2bc3ed2773bb213919 (patch) | |
tree | 63e8be1da62dfd1565f7a622c47094ef8fdb8d21 /src/udev/udev-builtin-blkid.c | |
parent | c620f9b90be84e1c19d2d0e84106ea7159848dc9 (diff) | |
download | systemd-a1bb2402cb6edc4b46f6bf2bc3ed2773bb213919.tar.gz |
udev-builtin-blkid: Use _cleanup_blkid_free_probe_ to free probe (#6108)
Use the _cleanup_blkid_free_probe_ to guarantee that the
blkid_probe will be freed when builtin_blkid exits.
Diffstat (limited to 'src/udev/udev-builtin-blkid.c')
-rw-r--r-- | src/udev/udev-builtin-blkid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c index 6319403620..4171bbd3ce 100644 --- a/src/udev/udev-builtin-blkid.c +++ b/src/udev/udev-builtin-blkid.c @@ -30,6 +30,7 @@ #include "sd-id128.h" #include "alloc-util.h" +#include "blkid-util.h" #include "efivars.h" #include "fd-util.h" #include "gpt.h" @@ -225,7 +226,7 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t int64_t offset = 0; bool noraid = false; _cleanup_close_ int fd = -1; - blkid_probe pr; + _cleanup_blkid_free_probe_ blkid_probe pr = NULL; const char *data; const char *name; const char *prtype = NULL; @@ -321,7 +322,6 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t if (is_gpt) find_gpt_root(dev, pr, test); - blkid_free_probe(pr); out: if (err < 0) return EXIT_FAILURE; |