]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
xgetXXbyYY: Avoid duplicated error handling block
authorSamanta Navarro <ferivoz@riseup.net>
Mon, 15 May 2023 11:59:23 +0000 (11:59 +0000)
committerSerge Hallyn <serge@hallyn.com>
Fri, 26 May 2023 21:03:27 +0000 (16:03 -0500)
The error handling is performed after the loop. By just calling break it
is possible to reuse the error handling if status is not ERANGE.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
libmisc/xgetXXbyYY.c

index 11e80e27c86a7475145318b9cd39dd3b405c254c..e977657c8af1a4e44df0ec68b9db4e73e17442a4 100644 (file)
@@ -81,9 +81,7 @@
                }
 
                if (ERANGE != status) {
-                       free (buffer);
-                       free (result);
-                       return NULL;
+                       break;
                }
 
                if (length <= ((size_t)-1 / 4)) {