]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/efivars.c
tree-wide: use TAKE_PTR() and TAKE_FD() macros
[thirdparty/systemd.git] / src / shared / efivars.c
index d31cf2d86016333deb58ce03ddf75488e3a337c5..af9587a1c2e8ff55b196f9a223539fd9bca086dd 100644 (file)
@@ -427,16 +427,12 @@ int efi_get_boot_option(
                 }
         }
 
-        if (title) {
-                *title = s;
-                s = NULL;
-        }
+        if (title)
+                *title = TAKE_PTR(s);
         if (part_uuid)
                 *part_uuid = p_uuid;
-        if (path) {
-                *path = p;
-                p = NULL;
-        }
+        if (path)
+                *path = TAKE_PTR(p);
         if (active)
                 *active = !!(header->attr & LOAD_OPTION_ACTIVE);
 
@@ -628,8 +624,8 @@ int efi_get_boot_options(uint16_t **options) {
 
         qsort_safe(list, count, sizeof(uint16_t), cmp_uint16);
 
-        *options = list;
-        list = NULL;
+        *options = TAKE_PTR(list);
+
         return count;
 }