]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/rfkill/rfkill.c
tree-wide: use TAKE_PTR() and TAKE_FD() macros
[thirdparty/systemd.git] / src / rfkill / rfkill.c
index ff951450b56ad66c992919972029f5e66e7764d8..bae3aec175738fed6a43fcb9e63bee7b5eea8047 100644 (file)
@@ -319,10 +319,9 @@ static int save_state_queue(
         if (!item)
                 return -ENOMEM;
 
-        item->file = state_file;
+        item->file = TAKE_PTR(state_file);
         item->rfkill_idx = event->idx;
         item->state = event->soft;
-        state_file = NULL;
 
         LIST_APPEND(queue, *write_queue, item);