Re: Patch: fix memory leak (spotted by Coverity)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following patch fixes a memory leak in FcConfigBuildFonts (Coverity
defect #985) in error case.

-- 
Frederic Crozat <fcrozat@xxxxxxxxxxxx>
Mandriva
Index: ChangeLog
===================================================================
RCS file: /cvs/fontconfig/fontconfig/ChangeLog,v
retrieving revision 1.109.2.193
diff -u -p -r1.109.2.193 ChangeLog
--- ChangeLog	11 Apr 2006 14:20:59 -0000	1.109.2.193
+++ ChangeLog	11 Apr 2006 15:05:26 -0000
@@ -1,3 +1,8 @@
+2006-04-11  Frederic Crozat  <fcrozat@xxxxxxxxxxxx>
+
+	* src/fccfg.c: (FcConfigBuildFonts):
+	Fix memory leak in error case (Coverity defect #985).
+
 2006-04-11  Patrick Lam  <plam@xxxxxxx>
 	* src/fccharset.c (FcCharSetPutLeaf):
 
Index: src/fccfg.c
===================================================================
RCS file: /cvs/fontconfig/fontconfig/src/fccfg.c,v
retrieving revision 1.49.2.26
diff -u -p -r1.49.2.26 fccfg.c
--- src/fccfg.c	10 Apr 2006 19:33:03 -0000	1.49.2.26
+++ src/fccfg.c	11 Apr 2006 15:05:26 -0000
@@ -283,7 +283,7 @@
     {
 	list = FcConfigGetFontDirs (config);
 	if (!list)
-	    goto bail2;
+	    goto bail3;
 	
 	while ((dir = FcStrListNext (list)))
 	{
@@ -334,9 +334,10 @@
     FcConfigSetFonts (config, fonts, FcSetSystem);
     
     return FcTrue;
+bail3:
+    FcStrSetDestroy (oldDirs);
 bail2:
     FcGlobalCacheDestroy (cache);
-    FcStrSetDestroy (oldDirs);
 bail1:
     FcFontSetDestroy (fonts);
 bail0:
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux