Re: Patch: fix memleak (spotted by Coverity)

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

 



Another memleak fix in FcGlobalCacheLoad from Coverity reports
( FcStrSetAdd already copies its second argument, no need to pass a copy
of it) and this time, it is not a corner case ;)

-- 
Frederic Crozat <fcrozat@xxxxxxxxxxxx>
Mandriva
Index: ChangeLog
===================================================================
RCS file: /cvs/fontconfig/fontconfig/ChangeLog,v
retrieving revision 1.109.2.185
diff -u -p -u -p -r1.109.2.185 ChangeLog
--- ChangeLog	7 Apr 2006 18:07:51 -0000	1.109.2.185
+++ ChangeLog	10 Apr 2006 14:58:25 -0000
@@ -1,3 +1,8 @@
+2006-04-10  Frederic Crozat  <fcrozat@xxxxxxxxxxxx>
+
+	* src/fccache.c: (FcGlobalCacheLoad):
+	Don't leak directory name (Coverity defect #1827).
+
 2006-04-07  Dominic Lachowicz  <cinamod@xxxxxxxxxxx>
 	reviewed by: plam
 	* fc-cache/Makefile.am:
Index: src/fccache.c
===================================================================
RCS file: /cvs/fontconfig/fontconfig/src/fccache.c,v
retrieving revision 1.23.4.80
diff -u -p -u -p -r1.23.4.80 fccache.c
--- src/fccache.c	7 Apr 2006 04:42:32 -0000	1.23.4.80
+++ src/fccache.c	10 Apr 2006 14:58:26 -0000
@@ -236,7 +236,7 @@
             FcCache md;
 	    off_t off;
 
-	    FcStrSetAdd (staleDirs, FcStrCopy ((FcChar8 *)name_buf));
+	    FcStrSetAdd (staleDirs, (FcChar8 *) name_buf);
 
 	    /* skip subdirs */
 	    while (FcCacheReadString (cache->fd, subdirName, 
_______________________________________________
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