mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-18 20:10:29 +01:00
WUtil: Make sure wmalloc/wrealloc won't fail because of the abort handler
As pointed by Coverity (#50074), despite the expected behaviour that 'wmalloc' should never return NULL, it may still happen if an abort handler set by user (with wsetabort) does not call exit() as expected. In such case we make sure the NULL pointer dereference does not happen inside WINGs code because we assume it is a known user choice. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
6ebec0bb9f
commit
816fa00625
@@ -107,6 +107,7 @@ void *wmalloc(size_t size)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tmp != NULL)
|
||||
memset(tmp, 0, size);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user