[Qemu-devel] Re: [PATCH] Allow usage of qemu_realloc(ptr, 0)

2009-12-29 Thread Michael S. Tsirkin
On Tue, Dec 29, 2009 at 05:38:17PM +0200, Michael S. Tsirkin wrote: > On Mon, Dec 28, 2009 at 04:49:00PM +0100, Aurelien Jarno wrote: > > realloc(ptr, 0) is always allowed by the standard. The return value is > > either NULL or a pointer that can be freed with free(). > > > > Allow usage of qemu_r

[Qemu-devel] Re: [PATCH] Allow usage of qemu_realloc(ptr, 0)

2009-12-29 Thread Michael S. Tsirkin
On Mon, Dec 28, 2009 at 04:49:00PM +0100, Aurelien Jarno wrote: > realloc(ptr, 0) is always allowed by the standard. The return value is > either NULL or a pointer that can be freed with free(). > > Allow usage of qemu_realloc(ptr, 0), and return NULL in that case, as > free(NULL) should always be

[Qemu-devel] Re: [PATCH] Allow usage of qemu_realloc(ptr, 0)

2009-12-28 Thread Aurelien Jarno
On Mon, Dec 28, 2009 at 04:49:00PM +0100, Aurelien Jarno wrote: > realloc(ptr, 0) is always allowed by the standard. The return value is > either NULL or a pointer that can be freed with free(). > > Allow usage of qemu_realloc(ptr, 0), and return NULL in that case, as > free(NULL) should always be