Problems found by infer
Matthew Seaman
matthew at FreeBSD.org
Fri Jun 12 12:39:47 UTC 2015
On 11/06/2015 23:33, Vsevolod Stakhov wrote:
> libpkg/pkg_printf.c:2883: error: MEMORY_LEAK
> memory dynamically allocated by call to sbuf_new() at line 2880,
> column 41 is not reachable after line 2883, column 3
>
> libpkg/pkg_printf.c:2928: error: MEMORY_LEAK
> memory dynamically allocated by call to sbuf_new() at line 2925,
> column 41 is not reachable after line 2928, column 3
>
> libpkg/pkg_printf.c:2977: error: MEMORY_LEAK
> memory dynamically allocated by call to sbuf_new() at line 2974,
> column 41 is not reachable after line 2977, column 3
>
> libpkg/pkg_printf.c:3031: error: MEMORY_LEAK
> memory dynamically allocated by call to sbuf_new() at line 3028,
> column 41 is not reachable after line 3031, column 3
>
> libpkg/pkg_printf.c:3083: error: MEMORY_LEAK
> memory dynamically allocated by call to sbuf_new() at line 3080,
> column 41 is not reachable after line 3083, column 3
These seem to be mostly a stylistic thing caused by this sort of code
pattern:
ptr = malloc(size);
ptr = do_something(ptr, arg1, arg2);
where 'do_something()' will either return the ptr unchanged or pass it
to free() and return NULL.
Dunno if there's a way to tell infer that's how those functions behave.
Cheers,
Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 971 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-pkg/attachments/20150612/1d44b570/attachment.sig>
More information about the freebsd-pkg
mailing list