aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/lib/lmalloc.c7
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)