mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 04:48:10 +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) (cherry picked from commit3de83dd25c)
This commit is contained in:
parent
46e595cb26
commit
cd619a5c92
1 changed files with 3 additions and 1 deletions
|
|
@ -122,8 +122,10 @@ fd_open:
|
||||||
*/
|
*/
|
||||||
has_high_quality = FALSE;
|
has_high_quality = FALSE;
|
||||||
|
|
||||||
if (G_UNLIKELY(!rand))
|
if (G_UNLIKELY(!rand)) {
|
||||||
rand = g_rand_new();
|
rand = g_rand_new();
|
||||||
|
nm_utils_thread_local_register_destroy(rand, (GDestroyNotify) g_rand_free);
|
||||||
|
}
|
||||||
|
|
||||||
nm_assert(n > 0);
|
nm_assert(n > 0);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue