I question the correctness of the changes checked into 7.7 last night by Nilsson (CVS comment "No longer allocate unused space for terminating char."). The +1 was not intended for accomodating a terminating character but to make sure zero-sized images get handled correctly in case malloc(0) returns NULL.
Well, it was either one way or the other. If +1 is needed, all occurances should have them.
Hm. A global macro for image allocations then. Remember that you have image allocations in a lot of places. The allocation of the newly identified GL leak is done with xalloc(img->width*img->height);
But then again people use different allocators in different situations...
Currently xalloc throws an error on zero-allocations. The possibility for xalloc to throw errors is one reason why people not always want to use it, since often it is easier to write an if-statement than using ONERROR.
pike-devel@lists.lysator.liu.se