Skip to content

Commit

Permalink
Fix memory leak on skipped xattrs
Browse files Browse the repository at this point in the history
Direct leak of 13 byte(s) in 1 object(s) allocated from:
    #0 0x7fb8d6c8f3cf in __interceptor_malloc (/lib64/libasan.so.6+0xab3cf)
    coreos#1 0x7fb8d6330bb8 in g_malloc (/lib64/libglib-2.0.so.0+0x5bbb8)
    coreos#2 0x7fb8d6345fe3 in g_strdup (/lib64/libglib-2.0.so.0+0x70fe3)
    coreos#3 0x7fb8d63726ef  (/lib64/libglib-2.0.so.0+0x9d6ef)
    coreos#4 0x7fb8d63728ff in g_variant_get_va (/lib64/libglib-2.0.so.0+0x9d8ff)
    coreos#5 0x7fb8d6372aa8 in g_variant_dict_lookup (/lib64/libglib-2.0.so.0+0x9daa8)
    coreos#6 0x5628e40c25b4 in filter_xattrs_impl src/libpriv/rpmostree-postprocess.cxx:1469
    coreos#7 0x5628e40c25b4 in filter_xattrs_cb src/libpriv/rpmostree-postprocess.cxx:1493
    coreos#8 0x7fb8d622db38  (/lib64/libostree-1.so.1+0x49b38)
    coreos#9 0x7fb8d6235b98  (/lib64/libostree-1.so.1+0x51b98)
    coreos#10 0x7fb8d6236fd5  (/lib64/libostree-1.so.1+0x52fd5)
    coreos#11 0x7fb8d6236a0f  (/lib64/libostree-1.so.1+0x52a0f)
    coreos#12 0x7fb8d623706b  (/lib64/libostree-1.so.1+0x5306b)
    coreos#13 0x7fb8d6236a0f  (/lib64/libostree-1.so.1+0x52a0f)
    coreos#14 0x7fb8d623706b  (/lib64/libostree-1.so.1+0x5306b)
    coreos#15 0x7fb8d623722b in ostree_repo_write_dfd_to_mtree (/lib64/libostree-1.so.1+0x5322b)
    coreos#16 0x5628e40b7e5e in write_dfd_thread src/libpriv/rpmostree-postprocess.cxx:1547
    coreos#17 0x7fb8d6356401  (/lib64/libglib-2.0.so.0+0x81401)
    coreos#18 0x7fb8d5abe3f8 in start_thread (/lib64/libpthread.so.0+0x93f8)
    coreos#19 0x7fb8d59ebb52 in __GI___clone (/lib64/libc.so.6+0x101b52)

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
  • Loading branch information
stefanberger committed Apr 5, 2021
1 parent b3436b7 commit e49e327
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libpriv/rpmostree-postprocess.cxx
Expand Up @@ -1465,10 +1465,11 @@ filter_xattrs_impl (OstreeRepo *repo,
if (tdata->xattr_translate != NULL)
{
const char *attrkey = g_variant_get_bytestring (key);
const char *target_xattr;
char *target_xattr;
if (!g_variant_dict_lookup (tdata->xattr_translate, attrkey, "s", &target_xattr))
{
// This must not have been an interested xattr
g_free(target_xattr);
continue;
}
g_variant_builder_add (&builder, "(@ay@ay)",
Expand Down

0 comments on commit e49e327

Please sign in to comment.