Skip to content

Commit

Permalink
switchroot: Use g_new/g_free consistently
Browse files Browse the repository at this point in the history
Coverity complains about this, even though they're the same thing.
  • Loading branch information
cgwalters committed Aug 25, 2023
1 parent d3ede20 commit 1a16a7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/libotcore/otcore-prepare-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ otcore_get_ostree_target (const char *cmdline, char **out_target, GError **error
{
if (strcmp (slot_suffix, "_a") == 0)
{
*out_target = strdup (slot_a);
*out_target = g_strdup (slot_a);
return TRUE;
}
else if (strcmp (slot_suffix, "_b") == 0)
{
*out_target = strdup (slot_b);
*out_target = g_strdup (slot_b);
return TRUE;
}
return glnx_throw (error, "androidboot.slot_suffix invalid: %s", slot_suffix);
Expand All @@ -98,7 +98,7 @@ otcore_get_ostree_target (const char *cmdline, char **out_target, GError **error
*/
if (proc_cmdline_has_key_starting_with (cmdline, "androidboot."))
{
*out_target = strdup (slot_a);
*out_target = g_strdup (slot_a);
return TRUE;
}

Expand Down
4 changes: 2 additions & 2 deletions src/switchroot/ostree-prepare-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ static void
free_composefs_config (ComposefsConfig *config)
{
g_ptr_array_unref (config->pubkeys);
free (config->signature_pubkey);
free (config);
g_free (config->signature_pubkey);
g_free (config);
}

G_DEFINE_AUTOPTR_CLEANUP_FUNC (ComposefsConfig, free_composefs_config)
Expand Down

0 comments on commit 1a16a7d

Please sign in to comment.