image: Fix a memleak
commit8165a3b483a01af1d7cac4864f0b6f20551ac1f3
authorUli Schlachter <psychon@znc.in>
Sat, 26 Sep 2009 09:01:51 +0000 (26 11:01 +0200)
committerJulien Danjou <julien@danjou.info>
Sat, 26 Sep 2009 11:20:00 +0000 (26 13:20 +0200)
treec62afd3b751a77c8a5b9383ac93b5acfd06cfa7f
parent539af16a6585c149cc0f2361c935390addc1d025
image: Fix a memleak

Before this patch, this code allocated a buffer and then created an imlib image
from this via imlib_create_using_copied_data(), but this function does not take
ownership of the buffer you pass in and thus we had a memory leak.

This is fixed by using a separate function for creating "empty" images which
doesn't have this memory leak problem.

This patch was verified using a quick valgrind run and seemed to be fine.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
image.c