Fix memory leak. Remove stream packing feature. Add errorcheck in packing.

This commit is contained in:
Naoki INADA
2009-07-01 20:55:24 +09:00
parent 03942a1b90
commit 78db826a75
2 changed files with 73 additions and 64 deletions

View File

@@ -72,7 +72,7 @@ static inline int msgpack_pack_write(msgpack_packer* pk, const char *data, size_
if (len + l > bs) {
bs = (len + l) * 2;
buf = realloc(pk->buf, bs);
buf = realloc(buf, bs);
if (!buf) return -1;
}
memcpy(buf + len, data, l);