Blame SOURCES/a2ps-resource-leak.patch

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