mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-30 07:26:29 +02:00
Fix for mismatched free() / delete / delete[]
When doing streaming deserialization, valgrind complains about mismatched free()... It's caused by calls to auto_ptr::free for zones that are null pointers.
This commit is contained in:
parent
79a06a338a
commit
3a2508545d
@ -226,12 +226,12 @@ inline bool unpacker::next(unpacked* result)
|
||||
}
|
||||
|
||||
if(ret == 0) {
|
||||
result->zone().reset();
|
||||
if (result->zone().get() != NULL) result->zone().reset();
|
||||
result->get() = object();
|
||||
return false;
|
||||
|
||||
} else {
|
||||
result->zone().reset( release_zone() );
|
||||
if (result->zone().get() != NULL) result->zone().reset( release_zone() );
|
||||
result->get() = data();
|
||||
reset();
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user