mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-09-20 01:59:57 +02:00
axfer/test: fix uninitialized warning
This commit fixes uninitialized return value from a call of test_vector()
to suppress a warning below.
gcc -DHAVE_CONFIG_H -I. -I../../include -O2 -Wall -pipe -g -MT mapper-test.o -MD -MP -MF .deps/mapper-test.Tpo -c -o mapper-test.o mapper-test.c
mapper-test.c: In function ‘test_vector’:
mapper-test.c:293:6: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int err;
^~~
Fixes: 39d1ab8a0c
: ('axfer: add a unit test for mapper interface')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
c43a62114a
commit
0248c29757
1 changed files with 3 additions and 1 deletions
|
@ -300,8 +300,10 @@ static int test_vector(struct mapper_trial *trial, snd_pcm_access_t access,
|
|||
|
||||
for (i = 0; i < cntr_count; ++i) {
|
||||
bufs[i] = malloc(size);
|
||||
if (bufs[i] == NULL)
|
||||
if (bufs[i] == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto end;
|
||||
}
|
||||
memset(bufs[i], 0, size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue