mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
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>
This commit is contained in:
parent
edfab83c07
commit
64ca85ceae
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user