Re: Patch: remove dead code / memleak (spotted by Coverity)

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

 



This patch remove dead code and memory leak from FcObjectUnserialize
(Coverity report #1194).

I think it is dead code since allocated variable is not used anywhere,
probably a leftover from previous version.
-- 
Frederic Crozat <fcrozat@xxxxxxxxxxxx>
Mandriva
Index: ChangeLog
===================================================================
RCS file: /cvs/fontconfig/fontconfig/ChangeLog,v
retrieving revision 1.109.2.192
diff -u -p -r1.109.2.192 ChangeLog
--- ChangeLog	11 Apr 2006 05:08:26 -0000	1.109.2.192
+++ ChangeLog	11 Apr 2006 13:32:13 -0000
@@ -1,3 +1,8 @@
+2006-04-11  Frederic Crozat  <fcrozat@xxxxxxxxxxxx>
+
+	* src/fcname.c: (FcObjectUnserialize):
+	Remove dead code (Coverity defect #1194).
+
 2006-04-11  Behdad Esfahbod  <behdad@xxxxxxxxxxxxxx>
 	reviewed by: plam
 
Index: src/fcname.c
===================================================================
RCS file: /cvs/fontconfig/fontconfig/src/fcname.c,v
retrieving revision 1.27.4.19
diff -u -p -r1.27.4.19 fcname.c
--- src/fcname.c	10 Apr 2006 21:04:54 -0000	1.27.4.19
+++ src/fcname.c	11 Apr 2006 13:32:13 -0000
@@ -381,19 +381,11 @@
 	int i;
 	char * bp = (char *)block_ptr;
 	FcObjectType * bn;
-	FcObjectTypeList * bnl;
 
 	bn = malloc (sizeof (const FcObjectType) * (new_biggest + 1));
 	if (!bn)
 	    return 0;
 
-	bnl = malloc (sizeof (FcObjectTypeList));
-	if (!bnl)
-	{
-	    free (bn);
-	    return 0;
-	}
-
 	for (i = 0; i < new_biggest; i++)
 	{
 	    const FcObjectType * t = FcNameGetObjectType(bp);
_______________________________________________
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