Fixed error induced by the gcc 4.7 patch. Incorrectly detected memory allocation failure