rem: sprintf(RErrorString, "out of memory");
add: RErrorCode = RERR_NOMEMORY;
context: RCreateImage(unsigned width, unsigned height, int alpha){    RImage *image=NULL;    int i;    assert(width>0 && height>0);    image = malloc(sizeof(RImage));    if (!image) {        sprintf(RErrorString, "out of memory");        return NULL;    }    memset(image, 0, sizeof(RImage));    image->width = width;    image->height = height;    for (i=0; i<3+(alpha?1:0); i++) {	image->data[i] = malloc(width*height);	if (!image->data[i])	  goto error;    }    return image;    error:    for (i=0; i<4; i++) {	if (image->data[i])	  free(image->data[i]);    }    if (image)      free(image);    sprintf(RErrorString, "out of memory");    return NULL;}