From: Daniel Golle Date: Fri, 18 Feb 2022 20:41:02 +0000 (+0000) Subject: instance: exit in case asprintf() fails X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ad652490d47916a27c01e3dd8f9eafcecbb4bc7f;p=project%2Fprocd.git instance: exit in case asprintf() fails If asprintf returns -1 we are most likely out of memory, so just exit in that case. Signed-off-by: Daniel Golle --- diff --git a/service/instance.c b/service/instance.c index 9c74265..8202d65 100644 --- 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;