Re: [PATCH i-g-t 3/7] lib: Stop igt_get_all_cairo_formats memory leak

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

 



On Tue, Apr 25, 2017 at 02:43:13PM -0300, Gabriel Krisman Bertazi wrote:
Brian Starkey <brian.starkey@xxxxxxx> writes:

igt_get_all_cairo_formats() allocates the format list on the heap, but
returns it in a const pointer. Change this so that callers can free the
array without a warning, and free the array in all callers.

Signed-off-by: Brian Starkey <brian.starkey@xxxxxxx>
---

Hi,

Assuming I'm not missing anything, I think if you free formats here, the
static variable in igt_get_all_cairo_formats() will point to garbage and
further calls to that function will return uninitialized memory.


Hi!

Yes, sorry you're quite right. I'd managed to completely miss the fact
the pointer is static.

Please ignore this patch then,

Thanks,
Brian


--
Gabriel Krisman Bertazi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux