mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -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
|
|
@ -167,8 +167,7 @@ int snd_midi_event_new(size_t bufsize, snd_midi_event_t **rdev)
|
|||
void snd_midi_event_free(snd_midi_event_t *dev)
|
||||
{
|
||||
if (dev != NULL) {
|
||||
if (dev->buf)
|
||||
free(dev->buf);
|
||||
free(dev->buf);
|
||||
free(dev);
|
||||
}
|
||||
}
|
||||
|
|
@ -253,8 +252,7 @@ int snd_midi_event_resize_buffer(snd_midi_event_t *dev, size_t bufsize)
|
|||
dev->buf = new_buf;
|
||||
dev->bufsize = bufsize;
|
||||
reset_encode(dev);
|
||||
if (old_buf)
|
||||
free(old_buf);
|
||||
free(old_buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue