Nowadays malloc() never fails, at least for small allocations.
Nowadays it may take longer for a daemon with a memory leak (even
if it's only leaking a couple hundred bytes at a time) to run the
system out of swap space, at least for systems with small (e.g. <
512TB) swap partitions. But it will happen eventually.
The computer is far more likely to break than to fail to deliver a kilobyte
of memory.
However the standard says it can fail, so to be strictly correct you need to
check it.
In the real world, you can run out of memory. I never thought that
an instance of a mail server process intended to handle one incoming
connection and then exit would run the system out of swap space,
even with a small per-email-message memory leak. It did. It turns
out that when it rejects SPAM, it leaked copies of the headers
(about 2K per message). Now add a persistent spammer who tried
sending a quarter million spams (not an exaggeration: I counted log
entries) in one connection over a period of a day and a half.