[Libguestfs] [PATCH 2/4] lib: uefi: reset out parameters earlier

Pino Toscano ptoscano at redhat.com
Thu Jan 16 12:27:03 UTC 2020


Make sure they are always reset, no matter the code branches later on.

This is mostly code motion.
---
 lib/appliance-uefi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/appliance-uefi.c b/lib/appliance-uefi.c
index 5fca8cd37..138a8d2f9 100644
--- a/lib/appliance-uefi.c
+++ b/lib/appliance-uefi.c
@@ -56,6 +56,9 @@
 int
 guestfs_int_get_uefi (guestfs_h *g, char **code, char **vars, int *flags)
 {
+  *code = *vars = NULL;
+  *flags = 0;
+
 #ifdef __aarch64__
   size_t i;
 
@@ -102,7 +105,5 @@ guestfs_int_get_uefi (guestfs_h *g, char **code, char **vars, int *flags)
 #endif
 
   /* Not found. */
-  *code = *vars = NULL;
-  *flags = 0;
   return 0;
 }
-- 
2.24.1




More information about the Libguestfs mailing list