Test function safe malloc for condition where the size requested is exceed the buffer size