I'm using the C interface to Xlib and I was wondering what the standard method of detecting memory allocation failures for this library is. I know its a rare issue, but I would like to be able to catch it to avoid segfaults when these are encountered. Any suggestions? Thanks.