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
This commit is contained in:
1 parent
bf9772f231
commit
712bf21914
13 files changed
+21
-63
No files matched your search
@@ -148,7 +148,7 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
GString *output = g_string_new ("");
|
||||
g_autoptr(GString) output = g_string_new ("");
|
||||
g_autoptr(GOutputStream) out_stream = NULL;
|
||||
g_autoptr(GPtrArray) loader_configs = NULL;
|
||||
guint i;
|
||||
@@ -260,8 +260,6 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
|
||||
|
||||
ret = TRUE;
|
||||
out:
|
||||
if (output)
|
||||
g_string_free (output, TRUE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user