diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-02-24 11:58:42 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-24 11:58:42 -0800 |
commit | 6d49c6741e71722a1c25bc1d7db30e6833898f9e (patch) | |
tree | 2721d33fd4b4b76609ddbe866a4972974502956c | |
parent | f3c1e08946a59b1aae2536436ea9384eafe3ad10 (diff) | |
download | syslinux-6d49c6741e71722a1c25bc1d7db30e6833898f9e.tar.gz |
lmalloc: set errno on failure
The core function can't set the com32 errno, so we need to do it in
the wrapper.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | com32/lib/lmalloc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/com32/lib/lmalloc.c b/com32/lib/lmalloc.c index a73817ed..cbd39a37 100644 --- a/com32/lib/lmalloc.c +++ b/com32/lib/lmalloc.c @@ -26,12 +26,17 @@ * ----------------------------------------------------------------------- */ #include <com32.h> +#include <errno.h> #include <stdlib.h> #include <syslinux/pmapi.h> void *lmalloc(size_t size) { - return __com32.cs_pm->lmalloc(size); + void *p; + p = __com32.cs_pm->lmalloc(size); + if (!p) + errno = ENOMEM; + return p; } void lfree(void *ptr) |