diff --git a/src/fcstr.c b/src/fcstr.c index 2f2cd4d..3b84ac0 100644 --- a/src/fcstr.c +++ b/src/fcstr.c @@ -733,7 +733,10 @@ FcStrBufDone (FcStrBuf *buf) { FcChar8 *ret; - ret = malloc (buf->len + 1); + if (buf->failed) + ret = NULL; + else + ret = malloc (buf->len + 1); if (ret) { FcMemAlloc (FC_MEM_STRING, buf->len + 1); @@ -752,6 +755,9 @@ FcStrBufChar (FcStrBuf *buf, FcChar8 c) FcChar8 *new; int size; + if (buf->failed) + return FcFalse; + if (buf->allocated) { size = buf->size * 2;