]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Get rid of double unlock in fr_atexit_global_once_ret() (CID #1518999) (#4855)
authorJames Jones <jejones3141@gmail.com>
Sun, 22 Jan 2023 15:52:11 +0000 (09:52 -0600)
committerGitHub <noreply@github.com>
Sun, 22 Jan 2023 15:52:11 +0000 (10:52 -0500)
src/lib/util/atexit.h

index 9987c537efede8ff60046bb2b75173e9c936febd..020b4775ef4426fc892c6b5958747f96fc76e687 100644 (file)
@@ -137,8 +137,9 @@ static inline int fr_atexit_talloc_free(void *to_free)
                                pthread_mutex_unlock(&_init_mutex); \
                        } \
                        atomic_store(&_init_done, true); \
+               } else { \
+                   pthread_mutex_unlock(&_init_mutex); \
                } \
-               pthread_mutex_unlock(&_init_mutex); \
        } \
        *(_ret) = 0; \
 }