mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 17:15:43 +01:00
topology: check for the remove() error (coverity)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
9ffc427802
commit
1dd37fddd8
1 changed files with 3 additions and 1 deletions
|
@ -183,7 +183,9 @@ static int save(const char *output_file, void *buf, size_t size)
|
|||
if (r < 0) {
|
||||
fprintf(stderr, _("Write error: %s\n"), strerror(-errno));
|
||||
if (fd != fileno(stdout)) {
|
||||
remove(fname);
|
||||
if (fname && remove(fname))
|
||||
fprintf(stderr, _("Unable to remove file %s: %s\n"),
|
||||
fname, strerror(-errno));
|
||||
close(fd);
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue