From ccf4d3cff3dde8976c9a29fc5cd25c38229c75e3 Mon Sep 17 00:00:00 2001 From: Sebastien Braun Date: Mon, 4 Oct 2010 00:12:21 +0200 Subject: Fix OpenPGM error handling bug resulting in spurious warnings and/or memory leaks. --- src/net/mcast/McastPGMSocket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/net/mcast') diff --git a/src/net/mcast/McastPGMSocket.cpp b/src/net/mcast/McastPGMSocket.cpp index bf52bd7..fa86d3b 100644 --- a/src/net/mcast/McastPGMSocket.cpp +++ b/src/net/mcast/McastPGMSocket.cpp @@ -447,7 +447,7 @@ void McastPGMSocket::handleData() { char buf[4096]; size_t size; - pgm_error_t* err; + pgm_error_t* err = 0; status = pgm_recv(_priv->socket, buf, sizeof(buf), MSG_DONTWAIT, &size, &err); @@ -496,6 +496,7 @@ void McastPGMSocket::handleData() qDebug() << " connection reset"; emit connectionReset(); qCritical() << "Connection Reset: PGM Error: " << (err ? err->message : "(null)"); + pgm_error_free(err); break; } else if (status == PGM_IO_STATUS_FIN) -- cgit v1.2.3-55-g7522