From: Samanta Navarro Date: Mon, 15 May 2023 11:59:23 +0000 (+0000) Subject: xgetXXbyYY: Avoid duplicated error handling block X-Git-Tag: 4.14.0-rc1~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dcc90658fd672c63e5498619e77f2d5a3d95f7d7;p=thirdparty%2Fshadow.git xgetXXbyYY: Avoid duplicated error handling block 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 --- diff --git a/libmisc/xgetXXbyYY.c b/libmisc/xgetXXbyYY.c index 11e80e27c..e977657c8 100644 --- a/libmisc/xgetXXbyYY.c +++ b/libmisc/xgetXXbyYY.c @@ -81,9 +81,7 @@ } if (ERANGE != status) { - free (buffer); - free (result); - return NULL; + break; } if (length <= ((size_t)-1 / 4)) {