diff options
author | Colin Walters <walters@verbum.org> | 2017-05-05 10:44:49 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-05-05 15:10:51 +0000 |
commit | 712bf219141bdb13c42629d518578b62906fcaa7 (patch) | |
tree | 4d1c62122eee6dbed8b1af8549fe7df4b3c8e90c /src/ostree/ot-admin-builtin-status.c | |
parent | bf9772f2316a567566c20979e5247b2928287253 (diff) | |
download | ostree-712bf219141bdb13c42629d518578b62906fcaa7.tar.gz |
tree-wide: Convert to using autoptr(GString) vs g_string_free(...,TRUE)
If we're freeing the segment, it's basically always better to use
`autoptr()`. Fewer lines, more reliable, etc.
Noticed an instance of this in the pull code while reviewing a different PR,
decided to do a grep for it and fix it tree wide.
Closes: #836
Approved by: pwithnall
Diffstat (limited to 'src/ostree/ot-admin-builtin-status.c')
-rw-r--r-- | src/ostree/ot-admin-builtin-status.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ostree/ot-admin-builtin-status.c b/src/ostree/ot-admin-builtin-status.c index 940e5df0..79621a1d 100644 --- a/src/ostree/ot-admin-builtin-status.c +++ b/src/ostree/ot-admin-builtin-status.c @@ -124,7 +124,6 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro OstreeDeploymentUnlockedState unlocked = ostree_deployment_get_unlocked (deployment); g_autofree char *version = version_of_commit (repo, ref); glnx_unref_object OstreeGpgVerifyResult *result = NULL; - GString *output_buffer; guint jj, n_signatures; GError *local_error = NULL; @@ -159,6 +158,7 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro if (deployment_get_gpg_verify (deployment, repo)) { + g_autoptr(GString) output_buffer = g_string_sized_new (256); /* Print any digital signatures on this commit. */ result = ostree_repo_verify_commit_ext (repo, ref, NULL, NULL, @@ -176,7 +176,6 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro goto out; } - output_buffer = g_string_sized_new (256); n_signatures = ostree_gpg_verify_result_count_all (result); for (jj = 0; jj < n_signatures; jj++) @@ -186,7 +185,6 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro } g_print ("%s", output_buffer->str); - g_string_free (output_buffer, TRUE); } } } |