Skip to content
  • Marc Alff's avatar
    6937844e
    BUG#31090258 A MEMORY LEAK MIGHT HAPPEN WHEN DOING LF_HASH_INSERT · 6937844e
    Marc Alff authored
    Problem
    
    In the implementation of the LF_HASH,
    Out Of Memory conditions (OOM)
    are triggering error code path that may leak memory.
    
    This was found by code review.
    
    Solution
    
    Analyze the code for OOM error paths,
    and add cleanup when necessary.
    
    In particular:
    
    In lf_alloc_new(),
    do not call the LF_ALLOCATOR::constructor
    when no node is allocated.
    
    In lf_hash_insert(),
    free the allocated "node" structure on various error paths,
    as per the bug report.
    
    In initialize_bucket(),
    free the allocated "dummy" structure on various error paths.
    
    With this fix, the LF_HASH implementation is more resilient
    to OOM conditions.
    
    Approved by: Chris Powers <chris.powers@oracle.com>
    6937844e
    BUG#31090258 A MEMORY LEAK MIGHT HAPPEN WHEN DOING LF_HASH_INSERT
    Marc Alff authored
    Problem
    
    In the implementation of the LF_HASH,
    Out Of Memory conditions (OOM)
    are triggering error code path that may leak memory.
    
    This was found by code review.
    
    Solution
    
    Analyze the code for OOM error paths,
    and add cleanup when necessary.
    
    In particular:
    
    In lf_alloc_new(),
    do not call the LF_ALLOCATOR::constructor
    when no node is allocated.
    
    In lf_hash_insert(),
    free the allocated "node" structure on various error paths,
    as per the bug report.
    
    In initialize_bucket(),
    free the allocated "dummy" structure on various error paths.
    
    With this fix, the LF_HASH implementation is more resilient
    to OOM conditions.
    
    Approved by: Chris Powers <chris.powers@oracle.com>
Loading