Blame SOURCES/a2ps-resource-leak.patch

f97431
diff -up a2ps-4.14/lib/encoding.c.resource-leak a2ps-4.14/lib/encoding.c
f97431
--- a2ps-4.14/lib/encoding.c.resource-leak	2011-08-10 16:02:26.244905923 +0100
f97431
+++ a2ps-4.14/lib/encoding.c	2011-08-10 16:41:39.578353192 +0100
f97431
@@ -554,7 +554,7 @@ encoding_resolve_font_substitute (struct
f97431
   if (!res)
f97431
     {
f97431
       if (encoding->default_font)
f97431
-	res = encoding->default_font;
f97431
+	res = xstrdup (encoding->default_font);
f97431
       else
f97431
 	error (1, 0, "Cannot find font %s, nor any substitute",
f97431
 	       font_name);
f97431
@@ -976,6 +976,7 @@ dump_encoding_setup (FILE * stream,
f97431
 							 font_names [i]);
f97431
       if (!font_is_to_reencode (job, real_font_name))
f97431
 	da_remove_at (encoding->font_names_used, i, (da_map_func_t) free);
f97431
+      free (real_font_name);
f97431
     }
f97431
 
f97431
   /* The number of fonts that, finally, have to be encoded
f97431
@@ -992,10 +993,16 @@ dump_encoding_setup (FILE * stream,
f97431
   fprintf (stream, "/%sdict %d dict begin\n", encoding->key,
f97431
 	   (encoding->composite_flag == true)? nb+nb+ns:nb+ns);
f97431
   for (i = 0 ; i < nb ; i++)
f97431
-    fprintf (stream, "  /f%s %sEncoding /%s reencode_font\n",
f97431
-	     font_names [i],
f97431
-	     encoding->name,
f97431
-	     encoding_resolve_font_substitute (job, encoding, font_names [i]));
f97431
+    {
f97431
+      char *real_font = encoding_resolve_font_substitute (job, encoding,
f97431
+							  font_names [i]);
f97431
+      fprintf (stream, "  /f%s %sEncoding /%s reencode_font\n",
f97431
+	       font_names [i],
f97431
+	       encoding->name,
f97431
+	       real_font);
f97431
+      free (real_font);
f97431
+    }
f97431
+	     
f97431
 
f97431
   /* Slant font setting */
f97431
   for (i = 0 ; encoding->slantfont[i].name ; i++ )
f97431
@@ -1166,6 +1173,7 @@ encoding_build_faces_wx (a2ps_job * job,
f97431
 				   encoding->vector,
f97431
 				   encoding->faces_wx [face]);
f97431
 
f97431
+      free (true_font_name);
f97431
       if (encoding->composite_flag)
f97431
 	{
f97431
 	  encoding->composite_raito[i] =