summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-12-12 15:54:50 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-12-14 12:26:16 +0000
commit64ca85ceaeb0375ff5931d45810015d5d2c774f1 (patch)
treeee69fe00d00719128b7628ac007401dcac8d7317
parentedfab83c07ccac635dae15f0b8ee30c662d239a3 (diff)
downloadglib-64ca85ceaeb0375ff5931d45810015d5d2c774f1.tar.gz
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 <simon.mcvittie@collabora.co.uk> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113 Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
-rw-r--r--glib/ghmac.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/glib/ghmac.c b/glib/ghmac.c
index 90ebf93b6..bc6e716d2 100644
--- a/glib/ghmac.c
+++ b/glib/ghmac.c
@@ -174,6 +174,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);