Use new0() function instead of new() followed by memset().