[subset] don't alloc zero bytes.

It will be leaked later since hb_blob_create() won't set up the blob to cleanup since it has length zero.
This commit is contained in:
Garret Rieger 2021-06-16 10:40:46 -07:00
parent 93e6a9bc4e
commit 675ebbeb3a
2 changed files with 2 additions and 0 deletions

View File

@ -547,6 +547,8 @@ struct hb_serialize_context_t
unsigned int len = (this->head - this->start)
+ (this->end - this->tail);
if (!len) return hb_bytes_t ();
char *p = (char *) malloc (len);
if (unlikely (!p)) return hb_bytes_t ();