[PATCH xvinfo] Resource cleanup fixes

Alan Coopersmith Alan.Coopersmith at Sun.COM
Mon Mar 22 14:00:55 PDT 2010


Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>

Jeff Smith wrote:
> Running xvinfo through valgrind (with no arguments to xvinfo) and
> 'no adaptors present' produced "still reachable: 41,247 bytes in 31 blocks."
> This patch reduces this to "still reachable: 35 bytes in 2 blocks."
> 
> Signed-off-by: Jeff Smith <whydoubt at yahoo.com>
> ---
>  xvinfo.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/xvinfo.c b/xvinfo.c
> index ea3b662..46c143b 100644
> --- a/xvinfo.c
> +++ b/xvinfo.c
> @@ -58,6 +58,7 @@ int main(int argc, char *argv[])
>      {
>  	fprintf(stderr, "xvinfo: No X-Video Extension on %s\n",
>                          (disname != NULL) ? disname : XDisplayName(NULL));
> +	XCloseDisplay(dpy);
>  	exit(0);
>      } 
>      else
> @@ -284,5 +285,6 @@ int main(int argc, char *argv[])
>  
>  	XvFreeAdaptorInfo(ainfo);
>      }
> +    XCloseDisplay(dpy);
>      return 1;
>  }

-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list