]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Fix for memory leak issue in ospf related to flood_reduction tests.
authorManoj Naragund <mnaragund@vmware.com>
Thu, 23 Mar 2023 12:59:38 +0000 (05:59 -0700)
committerManoj Naragund <mnaragund@vmware.com>
Thu, 23 Mar 2023 12:59:38 +0000 (05:59 -0700)
Problem:
Multiple memory leaks after pr12366

RCA:
ospf_lsa_unlock was not happening for the few of the LSAs in
ospf_lsa_refresh_walker after pr12366 due to which memory
related to lsas was leaking.

Fix:
Moved the ospf_lsa_unlock outside if check.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
ospfd/ospf_lsa.c

index f41e303efb2b48cf0d5463088b20c6c7daa607a3..da014bd02bd3125c89581e33f15277ecdb708fe7 100644 (file)
@@ -4099,11 +4099,11 @@ void ospf_lsa_refresh_walker(struct thread *t)
                dna_lsa = ospf_check_dna_lsa(lsa);
                if (!dna_lsa) { /* refresh only non-DNA LSAs */
                        ospf_lsa_refresh(ospf, lsa);
-                       assert(lsa->lock > 0);
-                       ospf_lsa_unlock(&lsa); /* lsa_refresh_queue & temp for
-                                               * lsa_to_refresh.
-                                               */
                }
+               assert(lsa->lock > 0);
+               ospf_lsa_unlock(&lsa); /* lsa_refresh_queue & temp for
+                                       * lsa_to_refresh.
+                                       */
        }
 
        list_delete(&lsa_to_refresh);