projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a87d010
)
instance: exit in case asprintf() fails
author
Daniel Golle
<daniel@makrotopia.org>
Fri, 18 Feb 2022 20:41:02 +0000
(20:41 +0000)
committer
Daniel Golle
<daniel@makrotopia.org>
Fri, 18 Feb 2022 20:44:34 +0000
(20:44 +0000)
If asprintf returns -1 we are most likely out of memory, so just exit
in that case.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
service/instance.c
patch
|
blob
|
history
diff --git
a/service/instance.c
b/service/instance.c
index 9c74265dc4fa92f729aa728c636033856ebdbea0..8202d65129a151fc47c6aacdfa268fdd3c7ccbf0 100644
(file)
--- a/
service/instance.c
+++ b/
service/instance.c
@@
-295,7
+295,9
@@
jail_run(struct service_instance *in, char **argv)
argv[argc++] = UJAIL_BIN_PATH;
- asprintf(&term_timeout_str, "%d", in->term_timeout);
+ if (asprintf(&term_timeout_str, "%d", in->term_timeout) == -1)
+ exit(ENOMEM);
+
argv[argc++] = "-t";
argv[argc++] = term_timeout_str;