ot-builtin-pull: Fix a minor leak with progress reporting
authorPhilip Withnall <pwithnall@endlessos.org>
Mon, 21 Nov 2022 16:35:02 +0000 (16:35 +0000)
committerPhilip Withnall <pwithnall@endlessos.org>
Mon, 21 Nov 2022 16:35:02 +0000 (16:35 +0000)
`ostree_async_progress_get_status()` returns an allocated string.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
src/ostree/ot-builtin-pull-local.c
src/ostree/ot-builtin-pull.c

index c39930afd4431c3bceaf8e1c3d6465883b0d8781..5dfaf887ceb15b61e32c067d4fea8b0b93a0df69 100644 (file)
@@ -211,7 +211,7 @@ ostree_builtin_pull_local (int argc, char **argv, OstreeCommandInvocation *invoc
     if (!console.is_tty)
       {
         g_assert (progress);
-        const char *status = ostree_async_progress_get_status (progress);
+        g_autofree char *status = ostree_async_progress_get_status (progress);
         if (status)
           g_print ("%s\n", status);
       }
index 61f408eb21f9a16a288b32ef726d20b7c01f5ce7..e6cc053b332437b08367ec312f247410736993af 100644 (file)
@@ -389,7 +389,7 @@ ostree_builtin_pull (int argc, char **argv, OstreeCommandInvocation *invocation,
     if (!console.is_tty && !opt_dry_run)
       {
         g_assert (progress);
-        const char *status = ostree_async_progress_get_status (progress);
+        g_autofree char *status = ostree_async_progress_get_status (progress);
         if (status)
           g_print ("%s\n", status);
       }