summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-13 21:21:52 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-13 23:42:17 -0400
commitd6483ba7834b9e63caee929c9d6373b796be1b21 (patch)
treee78adc5ad14fbd275f843e154abe5c6ff55f83cd /src/core/manager.c
parente64d523579dc6ed48db7ccdc5441c0adc33cd4e2 (diff)
core: check asprintf return value
CID #1261729.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 24a66a28af..d92e048e24 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -178,8 +178,10 @@ static void manager_print_jobs_in_progress(Manager *m) {
m->jobs_in_progress_iteration++;
- if (m->n_running_jobs > 1)
- asprintf(&job_of_n, "(%u of %u) ", counter, m->n_running_jobs);
+ if (m->n_running_jobs > 1) {
+ if (asprintf(&job_of_n, "(%u of %u) ", counter, m->n_running_jobs) < 0)
+ job_of_n = NULL;
+ }
format_timespan(time, sizeof(time), now(CLOCK_MONOTONIC) - j->begin_usec, 1*USEC_PER_SEC);
if (job_get_timeout(j, &x) > 0)