summaryrefslogtreecommitdiff
path: root/src/fcstr.c
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2012-06-01 19:06:17 +0900
committerAkira TAGOH <akira@tagoh.org>2012-06-01 19:06:17 +0900
commit1b692d8ab91a096e7d433c51ab187382de91147b (patch)
tree45f44a807da2812eab3043d2e8d375d9035db8ae /src/fcstr.c
parent5254a6630fdf132b0cda62c1bc7e8e40d2639bdf (diff)
downloadfontconfig-1b692d8ab91a096e7d433c51ab187382de91147b.tar.gz
Fix the wrong estimation for the memory usage information in fontconfig
Diffstat (limited to 'src/fcstr.c')
-rw-r--r--src/fcstr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/fcstr.c b/src/fcstr.c
index f20d05e..e372af0 100644
--- a/src/fcstr.c
+++ b/src/fcstr.c
@@ -833,6 +833,7 @@ FcStrBufChar (FcStrBuf *buf, FcChar8 c)
if (buf->allocated)
{
size = buf->size * 2;
+ FcMemFree (FC_MEM_STRBUF, buf->size);
new = realloc (buf->buf, size);
}
else
@@ -850,8 +851,6 @@ FcStrBufChar (FcStrBuf *buf, FcChar8 c)
buf->failed = FcTrue;
return FcFalse;
}
- if (buf->size)
- FcMemFree (FC_MEM_STRBUF, buf->size);
FcMemAlloc (FC_MEM_STRBUF, size);
buf->size = size;
buf->buf = new;