projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ebeaa54
)
Fix test bug when calloc returns null
author
Paul Eggert
<eggert@cs.ucla.edu>
Wed, 13 Oct 2021 00:10:46 +0000
(17:10 -0700)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Wed, 13 Oct 2021 00:22:07 +0000
(17:22 -0700)
* test/src/emacs-module-resources/mod-test.c (Fmod_test_userptr_make):
Don’t dump core if calloc returns null and signal_errno returns.
test/src/emacs-module-resources/mod-test.c
patch
|
blob
|
history
diff --git
a/test/src/emacs-module-resources/mod-test.c
b/test/src/emacs-module-resources/mod-test.c
index 5720af8c60525c0562b86472a6560a4a63a71387..4c0b168e34d395f544119e78c3ee83ab9426ff0e 100644
(file)
--- a/
test/src/emacs-module-resources/mod-test.c
+++ b/
test/src/emacs-module-resources/mod-test.c
@@
-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);
if (!p)
- signal_errno (env, "calloc");
+ {
+ signal_errno (env, "calloc");
+ return NULL;
+ }
p->amazing_int = env->extract_integer (env, args[0]);
return env->make_user_ptr (env, free, p);
}