From e1d758033dc7e101ab32323a0f1649d8daf56a22 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Tue, 24 Jun 2014 19:00:32 +0200 Subject: use more _cleanup_ macro --- src/shared/path-util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/shared/path-util.c') diff --git a/src/shared/path-util.c b/src/shared/path-util.c index d193494afb..fd35e0c786 100644 --- a/src/shared/path-util.c +++ b/src/shared/path-util.c @@ -442,7 +442,7 @@ int path_is_mount_point(const char *t, bool allow_symlink) { }; int mount_id, mount_id_parent; - char *parent; + _cleanup_free_ char *parent = NULL; struct stat a, b; int r; @@ -473,7 +473,6 @@ int path_is_mount_point(const char *t, bool allow_symlink) { h.handle.handle_bytes = MAX_HANDLE_SZ; r = name_to_handle_at(AT_FDCWD, parent, &h.handle, &mount_id_parent, 0); - free(parent); if (r < 0) { /* The parent can't do name_to_handle_at() but the * directory we are interested in can? If so, it must @@ -504,7 +503,6 @@ fallback: return r; r = lstat(parent, &b); - free(parent); if (r < 0) return -errno; -- cgit v1.2.3-54-g00ecf