mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
remove superfluous free() checks
free() correctly handles NULL pointers, so we can omit explicit checks for that condition.
This commit is contained in:
parent
45850439b3
commit
4433248bf3
33 changed files with 108 additions and 205 deletions
|
|
@ -466,8 +466,7 @@ static int snd_pcm_dshare_close(snd_pcm_t *pcm)
|
|||
snd_pcm_direct_client_discard(dshare);
|
||||
snd_pcm_direct_shm_discard(dshare);
|
||||
snd_pcm_direct_semaphore_up(dshare, DIRECT_IPC_SEM_CLIENT);
|
||||
if (dshare->bindings)
|
||||
free(dshare->bindings);
|
||||
free(dshare->bindings);
|
||||
pcm->private_data = NULL;
|
||||
free(dshare);
|
||||
return 0;
|
||||
|
|
@ -763,8 +762,7 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
|||
snd_pcm_direct_semaphore_up(dshare, DIRECT_IPC_SEM_CLIENT);
|
||||
_err_nosem:
|
||||
if (dshare) {
|
||||
if (dshare->bindings)
|
||||
free(dshare->bindings);
|
||||
free(dshare->bindings);
|
||||
free(dshare);
|
||||
}
|
||||
if (pcm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue