summaryrefslogtreecommitdiff
path: root/src/basic/mountpoint-util.c
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2022-11-30 15:18:15 +0100
committerDavid Tardon <dtardon@redhat.com>2022-12-13 15:47:52 +0100
commit229b008635a09839cbd5930fe6431397f144b3cb (patch)
tree2e7b91aac542e941c0845b4ea572d101153956c0 /src/basic/mountpoint-util.c
parent55371658793b7276fea30bdcd12252e1f75eb5e9 (diff)
downloadsystemd-229b008635a09839cbd5930fe6431397f144b3cb.tar.gz
mountpoint-util: reduce variable scope
Diffstat (limited to 'src/basic/mountpoint-util.c')
-rw-r--r--src/basic/mountpoint-util.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
index dc682688a7..c9253b03f2 100644
--- a/src/basic/mountpoint-util.c
+++ b/src/basic/mountpoint-util.c
@@ -37,7 +37,6 @@ int name_to_handle_at_loop(
int *ret_mnt_id,
int flags) {
- _cleanup_free_ struct file_handle *h = NULL;
size_t n = ORIGINAL_MAX_HANDLE_SZ;
assert((flags & ~(AT_SYMLINK_FOLLOW|AT_EMPTY_PATH)) == 0);
@@ -50,6 +49,7 @@ int name_to_handle_at_loop(
* as NULL if there's no interest in either. */
for (;;) {
+ _cleanup_free_ struct file_handle *h = NULL;
int mnt_id = -1;
h = malloc0(offsetof(struct file_handle, f_handle) + n);
@@ -91,8 +91,6 @@ int name_to_handle_at_loop(
n = h->handle_bytes;
if (offsetof(struct file_handle, f_handle) + n < n) /* check for addition overflow */
return -EOVERFLOW;
-
- h = mfree(h);
}
}