projects
/
platform
/
upstream
/
fontconfig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9581b4
)
Don't crash in FcPatternFormat() with NULL pattern
author
Behdad Esfahbod
<behdad@behdad.org>
Wed, 2 Jan 2013 02:20:31 +0000
(20:20 -0600)
committer
Behdad Esfahbod
<behdad@behdad.org>
Wed, 2 Jan 2013 02:20:31 +0000
(20:20 -0600)
src/fcformat.c
patch
|
blob
|
history
diff --git
a/src/fcformat.c
b/src/fcformat.c
index
a8a1ad1
..
59f8681
100644
(file)
--- a/
src/fcformat.c
+++ b/
src/fcformat.c
@@
-1193,15
+1193,19
@@
FcPatternFormat (FcPattern *pat,
{
FcStrBuf buf;
FcChar8 buf_static[8192 - 1024];
+ FcPattern *alloced = NULL;
FcBool ret;
if (!pat)
-
return NULL
;
+
alloced = pat = FcPatternCreate ()
;
FcStrBufInit (&buf, buf_static, sizeof (buf_static));
ret = FcPatternFormatToBuf (pat, format, &buf);
+ if (alloced)
+ FcPatternDestroy (alloced);
+
if (ret)
return FcStrBufDone (&buf);
else