summaryrefslogtreecommitdiff
path: root/src/pgm_socket.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-02-22 16:23:36 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-02-22 16:23:36 +0100
commit43e8868875e1d5287979e5b9060a9b16be45cc79 (patch)
treed6df0587b107de28641b429048dff002e3c2387f /src/pgm_socket.cpp
parent98ccff1a24a056aef15372b131eee1c1bf8f62ca (diff)
Added explicit error message in case of memory exhaustion
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/pgm_socket.cpp')
-rw-r--r--src/pgm_socket.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pgm_socket.cpp b/src/pgm_socket.cpp
index 9f96f6f..4b6c8b9 100644
--- a/src/pgm_socket.cpp
+++ b/src/pgm_socket.cpp
@@ -358,6 +358,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
zmq_assert (pgm_msgv_len);
pgm_msgv = (pgm_msgv_t*) malloc (sizeof (pgm_msgv_t) * pgm_msgv_len);
+ alloc_assert (pgm_msgv);
}
return 0;
@@ -602,7 +603,7 @@ ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_)
// Data loss.
if (status == PGM_IO_STATUS_RESET) {
- struct pgm_sk_buff_t* skb = pgm_msgv[0].msgv_skb[0];
+ struct pgm_sk_buff_t* skb = pgm_msgv [0].msgv_skb [0];
// Save lost data TSI.
*tsi_ = &skb->tsi;