mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04: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
|
|
@ -843,10 +843,8 @@ static int snd_pcm_hw_munmap_status(snd_pcm_t *pcm)
|
|||
snd_pcm_hw_t *hw = pcm->private_data;
|
||||
int err;
|
||||
if (hw->sync_ptr_ioctl) {
|
||||
if (hw->sync_ptr) {
|
||||
free(hw->sync_ptr);
|
||||
hw->sync_ptr = NULL;
|
||||
}
|
||||
free(hw->sync_ptr);
|
||||
hw->sync_ptr = NULL;
|
||||
} else {
|
||||
if (munmap((void*)hw->mmap_status, page_align(sizeof(*hw->mmap_status))) < 0) {
|
||||
err = -errno;
|
||||
|
|
@ -862,10 +860,8 @@ static int snd_pcm_hw_munmap_control(snd_pcm_t *pcm)
|
|||
snd_pcm_hw_t *hw = pcm->private_data;
|
||||
int err;
|
||||
if (hw->sync_ptr_ioctl) {
|
||||
if (hw->sync_ptr) {
|
||||
free(hw->sync_ptr);
|
||||
hw->sync_ptr = NULL;
|
||||
}
|
||||
free(hw->sync_ptr);
|
||||
hw->sync_ptr = NULL;
|
||||
} else {
|
||||
if (munmap(hw->mmap_control, page_align(sizeof(*hw->mmap_control))) < 0) {
|
||||
err = -errno;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue