Fix test bug when calloc returns null
* test/src/emacs-module-resources/mod-test.c (Fmod_test_userptr_make): Don’t dump core if calloc returns null and signal_errno returns.
This commit is contained in:
parent
ebeaa54f19
commit
f223ac6ef9
1 changed files with 4 additions and 1 deletions
|
@ -298,7 +298,10 @@ Fmod_test_userptr_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[],
|
||||||
{
|
{
|
||||||
struct super_struct *p = calloc (1, sizeof *p);
|
struct super_struct *p = calloc (1, sizeof *p);
|
||||||
if (!p)
|
if (!p)
|
||||||
signal_errno (env, "calloc");
|
{
|
||||||
|
signal_errno (env, "calloc");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
p->amazing_int = env->extract_integer (env, args[0]);
|
p->amazing_int = env->extract_integer (env, args[0]);
|
||||||
return env->make_user_ptr (env, free, p);
|
return env->make_user_ptr (env, free, p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue