diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-26 20:02:25 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-26 20:02:25 +0200 |
commit | 1af393838b4c9c5491035403af4c42c0e10f3846 (patch) | |
tree | 1973be1b90a873c1a67b98b310824cfce747ec7c | |
parent | update dist (diff) | |
download | bus-1af393838b4c9c5491035403af4c42c0e10f3846.tar.gz bus-1af393838b4c9c5491035403af4c42c0e10f3846.tar.bz2 bus-1af393838b4c9c5491035403af4c42c0e10f3846.tar.xz |
m bug: wrote to array before checking that it was successfully allocated
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |