mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-24 09:08:44 +02:00
Fixed redundant caluclation.
This commit is contained in:
parent
f24201f71f
commit
364fc0daf6
@ -197,7 +197,7 @@ static inline int template_callback_array(unpack_user* u, unsigned int n, msgpac
|
||||
// integer overflow
|
||||
return MSGPACK_UNPACK_NOMEM_ERROR;
|
||||
}
|
||||
o->via.array.ptr = (msgpack_object*)msgpack_zone_malloc(u->z, n*sizeof(msgpack_object));
|
||||
o->via.array.ptr = (msgpack_object*)msgpack_zone_malloc(u->z, size);
|
||||
if(o->via.array.ptr == NULL) { return MSGPACK_UNPACK_NOMEM_ERROR; }
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user