From 1af393838b4c9c5491035403af4c42c0e10f3846 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 26 Aug 2015 20:02:25 +0200 Subject: m bug: wrote to array before checking that it was successfully allocated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bus.c') diff --git a/src/bus.c b/src/bus.c index 7609de6..3205e25 100644 --- a/src/bus.c +++ b/src/bus.c @@ -262,9 +262,9 @@ create_semaphores(bus_t *bus) /* Initialise the array. */ values.array = calloc((size_t)BUS_SEMAPHORES, sizeof(unsigned short)); - values.array[X] = 1; if (!values.array) goto fail; + values.array[X] = 1; if (semctl(id, 0, SETALL, values.array) == -1) goto fail; free(values.array); -- cgit v1.2.3-70-g09d2