]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
delete lock after using it. CID #141442
authorAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2017 19:22:54 +0000 (15:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2017 19:22:54 +0000 (15:22 -0400)
src/lib/util/fring.c

index 1cb2313c76dfc88344b31d6aa68a0836d001d9b0..ee813605f22b7e44111ed8a966afe4c6d7fc538a 100644 (file)
@@ -55,13 +55,13 @@ static int _fring_free(fr_fring_t *fring)
 {
        void *next;
 
-       if (fring->lock) pthread_mutex_destroy(&fring->mutex);
-
        /*
         *      Free any data left in the buffer
         */
        while ((next = fr_fring_next(fring))) talloc_free(next);
 
+       if (fring->lock) pthread_mutex_destroy(&fring->mutex);
+
        return 0;
 }