Fix memory leaks in ProtobufDecoder

Issue: SPR-17418
This commit is contained in:
Arjen Poutsma
2018-10-22 13:39:22 +02:00
parent a64e85fcc6
commit 946ec7e22e
3 changed files with 32 additions and 29 deletions

View File

@@ -216,12 +216,18 @@ public class ProtobufDecoder extends ProtobufCodecSupport implements Decoder<Mes
} while (remainingBytesToRead > 0);
return messages;
}
catch (DecodingException ex) {
throw ex;
}
catch (IOException ex) {
throw new DecodingException("I/O error while parsing input stream", ex);
}
catch (Exception ex) {
throw new DecodingException("Could not read Protobuf message: " + ex.getMessage(), ex);
}
finally {
DataBufferUtils.release(input);
}
}
}