ot-builtin-pull: Fix a minor leak with progress reporting

`ostree_async_progress_get_status()` returns an allocated string.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-11-21 16:35:02 +00:00
parent 49d54d6ca8
commit c0b6cf9298
2 changed files with 2 additions and 2 deletions

View File

@ -211,7 +211,7 @@ ostree_builtin_pull_local (int argc, char **argv, OstreeCommandInvocation *invoc
if (!console.is_tty) if (!console.is_tty)
{ {
g_assert (progress); g_assert (progress);
const char *status = ostree_async_progress_get_status (progress); g_autofree char *status = ostree_async_progress_get_status (progress);
if (status) if (status)
g_print ("%s\n", status); g_print ("%s\n", status);
} }

View File

@ -389,7 +389,7 @@ ostree_builtin_pull (int argc, char **argv, OstreeCommandInvocation *invocation,
if (!console.is_tty && !opt_dry_run) if (!console.is_tty && !opt_dry_run)
{ {
g_assert (progress); g_assert (progress);
const char *status = ostree_async_progress_get_status (progress); g_autofree char *status = ostree_async_progress_get_status (progress);
if (status) if (status)
g_print ("%s\n", status); g_print ("%s\n", status);
} }