Am 15.12.2011 09:10, schrieb Zhi Hui Li: > > I am not sure whether it is need to check the return of g_malloc in > qemu ?
Compare the glib manual: http://developer.gnome.org/glib/2.30/glib-Memory-Allocation.html#g-malloc http://developer.gnome.org/glib/2.30/glib-Memory-Allocation.html#g-try-malloc So, g_malloc() may return NULL if the requested size is zero, and it may abort but does not return NULL due to insufficient memory available. HTH, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg