[ASAN] Squash a few minor misc leaks

This is part of the leak set when doing a treecompose.  There's
some that go down into libdnf...will get to that over time.

Closes: #547
Approved by: jlebon
This commit is contained in:
Colin Walters 2016-12-08 11:19:25 -05:00 committed by Atomic Bot
parent 23198fd553
commit 69cace4ce8
2 changed files with 6 additions and 5 deletions

View File

@ -609,7 +609,6 @@ rpmostree_compose_builtin_tree (int argc,
g_autoptr(GFile) yumroot = NULL;
glnx_fd_close int rootfs_fd = -1;
glnx_unref_object OstreeRepo *repo = NULL;
g_autoptr(GPtrArray) bootstrap_packages = NULL;
g_autoptr(GPtrArray) packages = NULL;
g_autoptr(GFile) treefile_path = NULL;
g_autoptr(GFile) treefile_dirpath = NULL;
@ -829,8 +828,7 @@ rpmostree_compose_builtin_tree (int argc,
g_variant_new_string (next_version));
}
bootstrap_packages = g_ptr_array_new ();
packages = g_ptr_array_new ();
packages = g_ptr_array_new_with_free_func (g_free);
if (json_object_has_member (treefile, "bootstrap_packages"))
{
@ -978,6 +976,8 @@ rpmostree_compose_builtin_tree (int argc,
* we delete below.
*/
g_clear_object (&corectx);
g_free (self->ref);
/* Move back out of the workding directory to ensure unmount works */
(void )chdir ("/");

View File

@ -327,7 +327,8 @@ do_kernel_prep (int rootfs_dfd,
g_autofree char* initramfs_path = NULL;
const char *boot_checksum_str = NULL;
g_autoptr(GChecksum) boot_checksum = NULL;
const char *kver = NULL;
const char *kver = NULL; /* May point to kver_owned */
g_autofree char *kver_owned = NULL;
g_autofree char *bootdir = g_strdup ("boot");
if (!find_kernel_and_initramfs_in_bootdir (rootfs_dfd, bootdir,
@ -375,7 +376,7 @@ do_kernel_prep (int rootfs_dfd,
kver_p = strchr (kname, '-');
g_assert (kver_p);
kver = g_strdup (kver_p + 1);
kver = kver_owned = g_strdup (kver_p + 1);
}
/* OSTree needs to own this */