mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 14:38:09 +02: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()') (cherry picked from commitc127e1becc)
This commit is contained in:
parent
724ef83e06
commit
3de83dd25c
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