From: David Tardon Date: Wed, 30 Nov 2022 14:18:15 +0000 (+0100) Subject: mountpoint-util: reduce variable scope X-Git-Tag: v253-rc1~294^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=229b008635a09839cbd5930fe6431397f144b3cb;p=thirdparty%2Fsystemd.git mountpoint-util: reduce variable scope --- diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c index dc682688a7c..c9253b03f2d 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); } }