Imported Upstream version 2.14.2
[platform/upstream/fontconfig.git] / src / fcfs.c
index 21c6c7c..a9c7aac 100644 (file)
@@ -42,13 +42,16 @@ FcFontSetCreate (void)
 void
 FcFontSetDestroy (FcFontSet *s)
 {
-    int            i;
+    if (s)
+    {
+       int         i;
 
-    for (i = 0; i < s->nfont; i++)
-       FcPatternDestroy (s->fonts[i]);
-    if (s->fonts)
-       free (s->fonts);
-    free (s);
+       for (i = 0; i < s->nfont; i++)
+           FcPatternDestroy (s->fonts[i]);
+       if (s->fonts)
+           free (s->fonts);
+       free (s);
+    }
 }
 
 FcBool