load_metadata_internal: don't leak GBytes

Found by valgrind memcheck. g_variant_new_from_bytes takes a ref to the
bytes, so we need to release the original ref.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #556
Approved by: cgwalters
This commit is contained in:
Simon McVittie 2016-10-30 13:52:51 +00:00 committed by Atomic Bot
parent 24af123c53
commit 8ae03d6497
1 changed files with 1 additions and 1 deletions

View File

@ -2593,7 +2593,7 @@ load_metadata_internal (OstreeRepo *self,
}
else
{
GBytes *data = glnx_fd_readall_bytes (fd, cancellable, error);
g_autoptr(GBytes) data = glnx_fd_readall_bytes (fd, cancellable, error);
if (!data)
goto out;
ret_variant = g_variant_new_from_bytes (ostree_metadata_variant_type (objtype),