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 17cbfa66ae
commit 2f09551573
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);