Fix read_proc_cmdline_key ("ot-composefs") memory leak
authorEric Curtin <ecurtin@redhat.com>
Thu, 8 Jun 2023 13:10:16 +0000 (14:10 +0100)
committerEric Curtin <ecurtin@redhat.com>
Thu, 8 Jun 2023 14:27:16 +0000 (15:27 +0100)
Make it an autofree_char rather than a char

src/switchroot/ostree-prepare-root.c

index d7b44d9be2669e4fbb2a713a68caf20012c062c2..dcb91431d36bd14fc1d9f0b0c668079de85572f7 100644 (file)
@@ -246,7 +246,7 @@ main (int argc, char *argv[])
     }
 
   OstreeComposefsMode composefs_mode = OSTREE_COMPOSEFS_MODE_MAYBE;
-  char *ot_composefs = read_proc_cmdline_key ("ot-composefs");
+  autofree char *ot_composefs = read_proc_cmdline_key ("ot-composefs");
   char *composefs_digest = NULL;
   if (ot_composefs)
     {