From 4071a5a97be47a47ab63e5bf7403f04383953500 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 13 Sep 2008 15:22:30 +0000 Subject: [PATCH] CID 930: Fix memory leak in error case. Note that this file has a completely different coding style, violating ours for consistency until the whole file can be cleaned up. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27480 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/midi/PortDrivers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/servers/midi/PortDrivers.cpp b/src/servers/midi/PortDrivers.cpp index e6f299f725..50c2624f63 100644 --- a/src/servers/midi/PortDrivers.cpp +++ b/src/servers/midi/PortDrivers.cpp @@ -100,6 +100,10 @@ int32 MidiPortProducer::GetData() if (read(fd, &next, 1) != 1) { perror("Error reading data from driver"); + if (haveSysEx) + { + free(sysexBuf); + } return B_ERROR; }