From dcc90658fd672c63e5498619e77f2d5a3d95f7d7 Mon Sep 17 00:00:00 2001 From: Samanta Navarro Date: Mon, 15 May 2023 11:59:23 +0000 Subject: [PATCH] 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 --- libmisc/xgetXXbyYY.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libmisc/xgetXXbyYY.c b/libmisc/xgetXXbyYY.c index 11e80e27..e977657c 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)) {