git: cam: Fix cam_sim_alloc() to avoid a potential memory leak

Aaron LI aly at crater.dragonflybsd.org
Fri May 8 18:29:02 PDT 2026


commit 78a2f6e540b907cd0321041da4fb0d4cf68a7ed0
Author: Aaron LI <aly at aaronly.me>
Date:   Fri May 8 20:54:55 2026 +0800

    cam: Fix cam_sim_alloc() to avoid a potential memory leak
    
    When both 'lock' and 'queue' were passed as NULL, the internally
    allocated 'queue' would become leaked memory.
    
    Simply assert 'lock' cannot be NULL to fix the bug.

Summary of changes:
 sys/bus/cam/cam_sim.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/78a2f6e540b907cd0321041da4fb0d4cf68a7ed0


-- 
DragonFly BSD source repository


More information about the Commits mailing list