[PATCH v2 01/25] [libx11] Fixed a missing call to XFreeFont

Alan Coopersmith alan.coopersmith at oracle.com
Mon Jan 31 19:20:27 PST 2011


On 01/31/11 04:01 AM, Erkki Seppälä wrote:
> Variable "fs" not freed or pointed-to in function "get_prop_name"
> 
> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
> ---
>  src/xlibi18n/XDefaultOMIF.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/src/xlibi18n/XDefaultOMIF.c b/src/xlibi18n/XDefaultOMIF.c
> index bc6b1b9..bb3986a 100644
> --- a/src/xlibi18n/XDefaultOMIF.c
> +++ b/src/xlibi18n/XDefaultOMIF.c
> @@ -398,7 +398,10 @@ get_font_name(
>  	if (fs == NULL) return NULL;
>  
>  	prop_name = get_prop_name(dpy, fs);
> -	if (prop_name == NULL) return NULL;
> +	if (prop_name == NULL) {
> +            XFreeFont(dpy, fs);
> +	    return NULL;
> +        }

The indenting is inconsistent there and should be fixed, but for the code itself:

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

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



More information about the xorg-devel mailing list