diff -ruN libxml2-2.6.21/xmlmemory.c libxml2-2.6.21-fixed/xmlmemory.c --- libxml2-2.6.21/xmlmemory.c 2005-05-08 13:31:15.000000000 +0200 +++ libxml2-2.6.21-fixed/xmlmemory.c 2005-09-11 11:33:13.631301960 +0200 @@ -409,6 +409,10 @@ size_t size; #endif + if (!ptr) { + goto error; + } + if (ptr == (void *) -1) { xmlGenericError(xmlGenericErrorContext, "trying to free pointer from freed area\n");