mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 08:50:07 +01:00
glib-aux: fix releasing thead-local GRand instance from nm_utils_random_bytes()
Fixes: b01a453ca2 ('core: add nm_utils_random_bytes() and use getrandom()')
This commit is contained in:
parent
b433c21ae4
commit
c127e1becc
1 changed files with 3 additions and 1 deletions
|
|
@ -122,8 +122,10 @@ fd_open:
|
|||
*/
|
||||
has_high_quality = FALSE;
|
||||
|
||||
if (G_UNLIKELY(!rand))
|
||||
if (G_UNLIKELY(!rand)) {
|
||||
rand = g_rand_new();
|
||||
nm_utils_thread_local_register_destroy(rand, (GDestroyNotify) g_rand_free);
|
||||
}
|
||||
|
||||
nm_assert(n > 0);
|
||||
i = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue