From 349083194d2064abf657494a15fc4bf456d80efd Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 29 Apr 2014 08:53:28 -0400 Subject: [PATCH] otutil: Correctly add ref to bytes when creating GVariant This one went undiscovered for a while because it turned out we weren't using it... --- src/libotutil/ot-variant-utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libotutil/ot-variant-utils.c b/src/libotutil/ot-variant-utils.c index 0f8e4bee..24e5b552 100644 --- a/src/libotutil/ot-variant-utils.c +++ b/src/libotutil/ot-variant-utils.c @@ -280,6 +280,7 @@ ot_variant_new_from_bytes (const GVariantType *type, #else gsize size; gconstpointer data = g_bytes_get_data (bytes, &size); + g_bytes_ref (bytes); return g_variant_new_from_data (type, data, size, trusted, (GDestroyNotify)g_bytes_unref, bytes); #endif