mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -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
|
|
@ -2102,10 +2102,8 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
|
|||
}
|
||||
if (type_conf)
|
||||
snd_config_delete(type_conf);
|
||||
if (buf)
|
||||
free(buf);
|
||||
if (buf1)
|
||||
free(buf1);
|
||||
free(buf);
|
||||
free(buf1);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -2187,12 +2185,9 @@ int snd_pcm_new(snd_pcm_t **pcmp, snd_pcm_type_t type, const char *name,
|
|||
int snd_pcm_free(snd_pcm_t *pcm)
|
||||
{
|
||||
assert(pcm);
|
||||
if (pcm->name)
|
||||
free(pcm->name);
|
||||
if (pcm->hw.link_dst)
|
||||
free(pcm->hw.link_dst);
|
||||
if (pcm->appl.link_dst)
|
||||
free(pcm->appl.link_dst);
|
||||
free(pcm->name);
|
||||
free(pcm->hw.link_dst);
|
||||
free(pcm->appl.link_dst);
|
||||
if (pcm->dl_handle)
|
||||
snd_dlclose(pcm->dl_handle);
|
||||
free(pcm);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue