Refer to the Content Policy for StackExchange for what is or is not permitted.
To quote this question on SE Meta regarding pirated content:
It's not our job to police pirated content.
You changed the link back to text but someone could just as easily
copy-paste the link and have access to the pirated content. Your heart
was in the right place but it is not our job as Stack Exchange users
to uphold someone else's copyright laws. No need to flag here...
If the OP so desperately wanted those links to still be clickable then
so-be-it.
You were 100% right not to start an edit war over something so
trivial.
That said, if we catch it as moderators we may do something about it. Flag it if you really think it's a problem, but keep in mind we handle things on a case-by-case basis. It's usually not necessarily flag-worthy, because you can just edit out links and leave comments about such evil links.
This in mind, we need to keep in mind that sites which are generic 'file upload' sites, while used for pirated content and malware, are not necessarily used solely for distribution of malware, we have to look at it on a case-by-case basis. Usually such 'upload sites' are not exactly the most reliable, nor is the linked content, so as moderators (or at least me as a moderator) we tend to recommend to individual users that they not use general upload sites.
This is a hugely broad category though so case-by-case basis. Any questions, ask a moderator. We usually lurk in chat. You can open a Meta post if you wish, but eh.
With regards to pornography or mature adult imagery:
We do not permit links to such content per the SE TOS and Terms of Use. Direct links to the content will be deleted, and repeated offenses of the TOS can result in moderation against a given user. Again, generic upload sites may be handled on a case by case basis.
With regards to malware, if you flag links going directly to malware we'll delete it. However, again, generic sites, case-by-case basis.