summaryrefslogtreecommitdiff
path: root/src/seq
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2006-02-27 09:58:32 +0000
committerClemens Ladisch <clemens@ladisch.de>2006-02-27 09:58:32 +0000
commit4433248bf3d6a89ca2136f41198ca2c9aa566953 (patch)
tree1f2ed4076d09433be3ed90721a654df9a4656d40 /src/seq
parent45850439b3b28ff7ed0d1455f62f5a85572caefa (diff)
remove superfluous free() checks
free() correctly handles NULL pointers, so we can omit explicit checks for that condition.
Diffstat (limited to 'src/seq')
-rw-r--r--src/seq/seq.c12
-rw-r--r--src/seq/seq_midi_event.c6
2 files changed, 6 insertions, 12 deletions
diff --git a/src/seq/seq.c b/src/seq/seq.c
index 07954a35..a2424c9a 100644
--- a/src/seq/seq.c
+++ b/src/seq/seq.c
@@ -1029,14 +1029,10 @@ int snd_seq_close(snd_seq_t *seq)
int err;
assert(seq);
err = seq->ops->close(seq);
- if (seq->obuf)
- free(seq->obuf);
- if (seq->ibuf)
- free(seq->ibuf);
- if (seq->tmpbuf)
- free(seq->tmpbuf);
- if (seq->name)
- free(seq->name);
+ free(seq->obuf);
+ free(seq->ibuf);
+ free(seq->tmpbuf);
+ free(seq->name);
free(seq);
return err;
}
diff --git a/src/seq/seq_midi_event.c b/src/seq/seq_midi_event.c
index b1495456..20ba808a 100644
--- a/src/seq/seq_midi_event.c
+++ b/src/seq/seq_midi_event.c
@@ -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;
}