diff --git a/kernel/base/vm/los_vm_syscall.c b/kernel/base/vm/los_vm_syscall.c index a8f85eeca1c2904ec734a55304e57a91adeb0747..11e8c2fc5d509fb67d0de1b37d04f307dbfb51bb 100644 --- a/kernel/base/vm/los_vm_syscall.c +++ b/kernel/base/vm/los_vm_syscall.c @@ -186,7 +186,8 @@ VOID *LOS_DoBrk(VOID *addr) (VOID)LOS_MuxAcquire(&space->regionMux); if ((UINTPTR)alignAddr >= space->mapBase) { VM_ERR("Process heap memory space is insufficient"); - return (VOID *)-ENOMEM; + ret = (VOID *)-ENOMEM; + goto REGION_ALLOC_FAILED; } if (space->heapBase == space->heapNow) { region = LOS_RegionAlloc(space, space->heapBase, size,