Fixed redundant caluclation.

This commit is contained in:
Takatoshi Kondo 2016-12-14 10:02:49 +09:00
parent f24201f71f
commit 364fc0daf6

View File

@ -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;
}