Skip to content

Commit 9d37316

Browse files
authored
Merge pull request #549 from redboltz/fix_redundant_calc
Fixed redundant caluclation.
2 parents f24201f + 364fc0d commit 9d37316

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static inline int template_callback_array(unpack_user* u, unsigned int n, msgpac
197197
// integer overflow
198198
return MSGPACK_UNPACK_NOMEM_ERROR;
199199
}
200-
o->via.array.ptr = (msgpack_object*)msgpack_zone_malloc(u->z, n*sizeof(msgpack_object));
200+
o->via.array.ptr = (msgpack_object*)msgpack_zone_malloc(u->z, size);
201201
if(o->via.array.ptr == NULL) { return MSGPACK_UNPACK_NOMEM_ERROR; }
202202
return 0;
203203
}

0 commit comments

Comments
 (0)