Zack Weinberg wrote : > free(NULL) is defined to be a no-op, so the code should be safe as is. No, free(NULL) can crash the program with many old malloc implementations. That is also valid for realloc(NULL, ). Philippe