malloc protection and wes_error as a variadic macro