From bc2e3d037955ae4419778bf19edb517ddddb4493 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 12 Dec 2011 15:54:50 +0000 Subject: [PATCH] g_hmac_copy: initialize the refcount In practice, the uninitialized refcount will typically mean that the copy is never freed, and leaks. Signed-off-by: Simon McVittie Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113 Reviewed-by: Emmanuele Bassi --- glib/ghmac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/glib/ghmac.c b/glib/ghmac.c index 20e8fcdf8..340511731 100644 --- a/glib/ghmac.c +++ b/glib/ghmac.c @@ -173,6 +173,7 @@ g_hmac_copy (const GHmac *hmac) g_return_val_if_fail (hmac != NULL, NULL); copy = g_slice_new (GHmac); + copy->ref_count = 1; copy->digest_type = hmac->digest_type; copy->digesti = g_checksum_copy (hmac->digesti); copy->digesto = g_checksum_copy (hmac->digesto);