To be up to good programming practices we should close the input even on
the error paths on lines 1381, 1392 and 1400 (it can be stdin, but on exit
it doesn't matter).
Scanner is sooo leaky, that pedantically closing read-only input file on
every error path may seem a little bit useless, but it is the first nice
step to get rid of the leaks and
errors from whatever tool Denis used to find this leak.

Cheers,
Marek

On Sat, Jun 20, 2015 at 12:54 AM, Bryce Harrington <[email protected]>
wrote:

> Addresses this error reported by Denis Denisov:
>
>   [src/scanner.c:1415]: (error) Resource leak: input
>
> Signed-off-by: Bryce Harrington <[email protected]>
> ---
>  src/scanner.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/scanner.c b/src/scanner.c
> index 7d8cfb9..2843d85 100644
> --- a/src/scanner.c
> +++ b/src/scanner.c
> @@ -1415,5 +1415,6 @@ int main(int argc, char *argv[])
>                         break;
>         }
>
> +       fclose(input);
>         return 0;
>  }
> --
> 1.9.1
>
> _______________________________________________
> wayland-devel mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to