Copy data and free data with free().

2001-02-19 Alexander Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
	Copy data and free data with free().

	* gdk-pixbuf/gdk-pixbuf.c:
	* gdk-pixbuf/io-jpeg.c:
	* gdk-pixbuf/io-png.c:
	Use g_try_malloc/g_free instead malloc/free.

	* gdk-pixbuf/test-gdk-pixbuf.c:
	Must... initialize... gobject...

	* gdk-pixbuf/pixops/timescale.c:
	* gtk/gtkcalendar.c:
	Use g_malloc instead of malloc.
This commit is contained in:
Alexander Larsson
2001-02-19 14:35:25 +00:00
committed by Alexander Larsson
parent 1f6effe99b
commit ba46da61a7
14 changed files with 148 additions and 21 deletions

View File

@ -126,7 +126,12 @@ gdk_image_new_bitmap(GdkVisual *visual,
image->bpp = 1;
image->bpl = (w+7)/8;
image->mem = g_malloc (image->bpl * h / 8);
memcpy (image->mem, data, image->bpl * h / 8);
/* This must be freed using free, not g_free, since in the X version
this is freed by xlib. */
free (data);
return image;
}