mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-26 14:34:02 +02:00
Fixed #794.
Buffer is expanded not only Z_OK, but also Z_BUF_ERROR case.
This commit is contained in:
parent
7e23ec496a
commit
6954e01338
@ -69,6 +69,7 @@ public:
|
||||
case Z_STREAM_END:
|
||||
return m_data;
|
||||
case Z_OK:
|
||||
case Z_BUF_ERROR:
|
||||
if(!expand()) {
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
|
@ -146,6 +146,7 @@ static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf)
|
||||
case Z_STREAM_END:
|
||||
return zbuf->data;
|
||||
case Z_OK:
|
||||
case Z_BUF_ERROR:
|
||||
if(!msgpack_zbuffer_expand(zbuf)) {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user