summaryrefslogtreecommitdiff
path: root/src/shared/path-util.c
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2014-06-24 19:00:32 +0200
committerTom Gundersen <teg@jklm.no>2014-06-24 19:09:57 +0200
commite1d758033dc7e101ab32323a0f1649d8daf56a22 (patch)
treea1688425a3c125569b34dc0e28318361245b2bc8 /src/shared/path-util.c
parent6ec60d20724d2a32e20d25ef75d2af178c242bc2 (diff)
use more _cleanup_ macro
Diffstat (limited to 'src/shared/path-util.c')
-rw-r--r--src/shared/path-util.c4
1 files changed, 1 insertions, 3 deletions
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;