[ENOMEM] fix memory leak if allocation fails during pop_pack().
This commit is contained in:
parent
42237adffc
commit
15644ee60e
|
@ -256,8 +256,12 @@ struct hb_serialize_context_t
|
||||||
|
|
||||||
packed.push (obj);
|
packed.push (obj);
|
||||||
|
|
||||||
if (unlikely (packed.in_error ()))
|
if (unlikely (packed.in_error ())) {
|
||||||
|
// obj wasn't successfully added to packed, so clean it up otherwise it's
|
||||||
|
// links will be leaked.
|
||||||
|
obj->fini ();
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
objidx = packed.length - 1;
|
objidx = packed.length - 1;
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue