Re: apparent bug about check_free_strict

Dan Carpenter <[email protected]> Tue, 25 Nov 2025 16:50:06 +0300
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
On Tue, Nov 25, 2025 at 03:37:08PM +0200, Toomas Soome wrote:
> 
> Ok, i did pull your latest update, and the problem is still there. I actually got very graphical example:
> 
> /code/illumos-gate/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../smb_share_doorclnt.c:274 smb_share_count() warn: passing freed memory 'dec_ctx' (line 272)
> /code/illumos-gate/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../smb_share_doorclnt.c:279 smb_share_count() warn: passing freed memory 'dec_ctx' (line 272)
> 

These warnings are almost certainly caused because Smatch thinks
smb_share_dchk() is freeing the pointer.  It generates two warnings
because the if and else paths are handled separately.

It's possible this is a Makefile bug...  Could you do a make clean
and rebuild Smatch?

regards,
dan carpenter