Attack was planned in South Waziristan: Malik