Re: fontconfig: Branch 'master'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Don't you hate when you spot the mistakes in your e-mail as soon as it
 arrives back in your inbox?   I did mention not testing either suggestion,
 right?)

On 05/30/12 07:59 AM, Alan Coopersmith wrote:
> +        if (total_len > flen) {
> +            char *new_f = realloc(f, total_len);
> +            if (!new_f)
> +            {
> +                free(f);

Actually, since we continue looping, probably don't want to free(f),
so that we can just use it the next time through - if you do free it,
then f needs to be set to NULL to avoid double free, and flen needs
to be reset to 0 so we start the allocation anew on the next loop.

> +                ret = -1;
> +                goto bail;
> +            }
> +            f = new_f;

There should of course also be:
		flen = total_len;
here.

> +        }



-- 
	-Alan Coopersmith-              alan.coopersmith@xxxxxxxxxx
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig


[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux