uml: improved error handling while locating temp dir
* arch/um/os-Linux/mem.c (make_tempfile): Don't deref NULL upon failed malloc.
* arch/um/os-Linux/mem.c (make_tempfile): Handle NULL tempdir.
Don't let a long tempdir (e.g., via TMPDIR) provoke heap corruption.
[ jdike - formatting cleanups, deleted obsolete comment ]
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>