summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2020-04-28 16:50:49 +0000
committerJonathan Kew <jfkthame@googlemail.com>2020-04-28 16:50:49 +0000
commit6edaaa4d1823518a97fb4cc3004d110b1046f742 (patch)
tree6e8124e6acc87d6cd4f8cbba1560125c03110aff
parentf3e049967ea4905d84f6b4f2b4e70848f5851cc0 (diff)
Set name_mapping to NULL after freeing
To avoid risk of double-free. Fixes #237.
-rw-r--r--src/fcfreetype.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index cd8fa43..bfbd5d7 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1627,7 +1627,10 @@ FcFreeTypeQueryFaceInternal (const FT_Face face,
}
}
if (!nm_share)
+ {
free (name_mapping);
+ name_mapping = NULL;
+ }
if (!nfamily && face->family_name &&
FcStrCmpIgnoreBlanksAndCase ((FcChar8 *) face->family_name, (FcChar8 *) "") != 0)