• Ganesh Ajjanagadde's avatar
    lavfi/show_palette: fix memory leak · 00c32201
    Ganesh Ajjanagadde authored
    Recent commits 6aaac24d and
    3835554b made progress towards cleaning
    up usage of the formats API, and in particular fixed possible NULL pointer
    dereferences.
    
    This commit addresses the issue of possible resource leaks when some intermediate
    call fails. Unfortunately, even leaving aside this subtle intermediate
    failure aspect, commit 80876320 was only
    partially successful in addressing memleaks. Hopefully, this commit
    fixes the issue completely.
    
    Tested with valgrind --leak-check=full --show-leak-kinds=all, and manual simulation
    of malloc/realloc failures.
    
    Fixes: CID 1270818.
    Reviewed-by: 's avatarClément Bœsch <u@pkh.me>
    Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
    00c32201
vf_showpalette.c 4.04 KB