Karsten Hopp 943650
To: vim_dev@googlegroups.com
Karsten Hopp 943650
Subject: Patch 7.4.533
Karsten Hopp 943650
Fcc: outbox
Karsten Hopp 943650
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 943650
Mime-Version: 1.0
Karsten Hopp 943650
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 943650
Content-Transfer-Encoding: 8bit
Karsten Hopp 943650
------------
Karsten Hopp 943650
Karsten Hopp 943650
Patch 7.4.533
Karsten Hopp 943650
Problem:    ":hardcopy" leaks memory in case of errors.
Karsten Hopp 943650
Solution:   Free memory in all code paths. (Christian Brabandt)
Karsten Hopp 943650
Files:	    src/hardcopy.c
Karsten Hopp 943650
Karsten Hopp 943650
Karsten Hopp 943650
*** ../vim-7.4.532/src/hardcopy.c	2013-05-06 04:00:47.000000000 +0200
Karsten Hopp 943650
--- src/hardcopy.c	2014-11-27 17:35:48.418285820 +0100
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 2960,2971 ****
Karsten Hopp 943650
      if (!prt_find_resource("prolog", res_prolog))
Karsten Hopp 943650
      {
Karsten Hopp 943650
  	EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
Karsten Hopp 943650
! 	return FALSE;
Karsten Hopp 943650
      }
Karsten Hopp 943650
      if (!prt_open_resource(res_prolog))
Karsten Hopp 943650
! 	return FALSE;
Karsten Hopp 943650
      if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION))
Karsten Hopp 943650
! 	return FALSE;
Karsten Hopp 943650
  #ifdef FEAT_MBYTE
Karsten Hopp 943650
      if (prt_out_mbyte)
Karsten Hopp 943650
      {
Karsten Hopp 943650
--- 2960,2971 ----
Karsten Hopp 943650
      if (!prt_find_resource("prolog", res_prolog))
Karsten Hopp 943650
      {
Karsten Hopp 943650
  	EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
Karsten Hopp 943650
! 	goto theend;
Karsten Hopp 943650
      }
Karsten Hopp 943650
      if (!prt_open_resource(res_prolog))
Karsten Hopp 943650
! 	goto theend;
Karsten Hopp 943650
      if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION))
Karsten Hopp 943650
! 	goto theend;
Karsten Hopp 943650
  #ifdef FEAT_MBYTE
Karsten Hopp 943650
      if (prt_out_mbyte)
Karsten Hopp 943650
      {
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 2973,2984 ****
Karsten Hopp 943650
  	if (!prt_find_resource("cidfont", res_cidfont))
Karsten Hopp 943650
  	{
Karsten Hopp 943650
  	    EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	if (!prt_open_resource(res_cidfont))
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
  	if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION))
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
      }
Karsten Hopp 943650
  #endif
Karsten Hopp 943650
  
Karsten Hopp 943650
--- 2973,2984 ----
Karsten Hopp 943650
  	if (!prt_find_resource("cidfont", res_cidfont))
Karsten Hopp 943650
  	{
Karsten Hopp 943650
  	    EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	if (!prt_open_resource(res_cidfont))
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
  	if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION))
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
      }
Karsten Hopp 943650
  #endif
Karsten Hopp 943650
  
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 3012,3023 ****
Karsten Hopp 943650
  		{
Karsten Hopp 943650
  		    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp 943650
  			    p_encoding);
Karsten Hopp 943650
! 		    return FALSE;
Karsten Hopp 943650
  		}
Karsten Hopp 943650
  	    }
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	if (!prt_open_resource(res_encoding))
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
  	/* For the moment there are no checks on encoding resource files to
Karsten Hopp 943650
  	 * perform */
Karsten Hopp 943650
  #ifdef FEAT_MBYTE
Karsten Hopp 943650
--- 3012,3023 ----
Karsten Hopp 943650
  		{
Karsten Hopp 943650
  		    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp 943650
  			    p_encoding);
Karsten Hopp 943650
! 		    goto theend;
Karsten Hopp 943650
  		}
Karsten Hopp 943650
  	    }
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	if (!prt_open_resource(res_encoding))
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
  	/* For the moment there are no checks on encoding resource files to
Karsten Hopp 943650
  	 * perform */
Karsten Hopp 943650
  #ifdef FEAT_MBYTE
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 3034,3043 ****
Karsten Hopp 943650
  	    {
Karsten Hopp 943650
  		EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp 943650
  							  prt_ascii_encoding);
Karsten Hopp 943650
! 		return FALSE;
Karsten Hopp 943650
  	    }
Karsten Hopp 943650
  	    if (!prt_open_resource(res_encoding))
Karsten Hopp 943650
! 		return FALSE;
Karsten Hopp 943650
  	    /* For the moment there are no checks on encoding resource files to
Karsten Hopp 943650
  	     * perform */
Karsten Hopp 943650
  	}
Karsten Hopp 943650
--- 3034,3043 ----
Karsten Hopp 943650
  	    {
Karsten Hopp 943650
  		EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp 943650
  							  prt_ascii_encoding);
Karsten Hopp 943650
! 		goto theend;
Karsten Hopp 943650
  	    }
Karsten Hopp 943650
  	    if (!prt_open_resource(res_encoding))
Karsten Hopp 943650
! 		goto theend;
Karsten Hopp 943650
  	    /* For the moment there are no checks on encoding resource files to
Karsten Hopp 943650
  	     * perform */
Karsten Hopp 943650
  	}
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 3050,3056 ****
Karsten Hopp 943650
  	{
Karsten Hopp 943650
  	    EMSG2(_("E620: Unable to convert to print encoding \"%s\""),
Karsten Hopp 943650
  		    p_encoding);
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	prt_do_conv = TRUE;
Karsten Hopp 943650
      }
Karsten Hopp 943650
--- 3050,3056 ----
Karsten Hopp 943650
  	{
Karsten Hopp 943650
  	    EMSG2(_("E620: Unable to convert to print encoding \"%s\""),
Karsten Hopp 943650
  		    p_encoding);
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	prt_do_conv = TRUE;
Karsten Hopp 943650
      }
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 3063,3072 ****
Karsten Hopp 943650
  	{
Karsten Hopp 943650
  	    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp 943650
  								    prt_cmap);
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	if (!prt_open_resource(res_cmap))
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
      }
Karsten Hopp 943650
  #endif
Karsten Hopp 943650
  
Karsten Hopp 943650
--- 3063,3072 ----
Karsten Hopp 943650
  	{
Karsten Hopp 943650
  	    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp 943650
  								    prt_cmap);
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
  	}
Karsten Hopp 943650
  	if (!prt_open_resource(res_cmap))
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
      }
Karsten Hopp 943650
  #endif
Karsten Hopp 943650
  
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 3140,3154 ****
Karsten Hopp 943650
  
Karsten Hopp 943650
      /* Add required procsets - NOTE: order is important! */
Karsten Hopp 943650
      if (!prt_add_resource(res_prolog))
Karsten Hopp 943650
! 	return FALSE;
Karsten Hopp 943650
  #ifdef FEAT_MBYTE
Karsten Hopp 943650
      if (prt_out_mbyte)
Karsten Hopp 943650
      {
Karsten Hopp 943650
  	/* Add CID font procset, and any user supplied CMap */
Karsten Hopp 943650
  	if (!prt_add_resource(res_cidfont))
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
  	if (prt_custom_cmap && !prt_add_resource(res_cmap))
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
      }
Karsten Hopp 943650
  #endif
Karsten Hopp 943650
  
Karsten Hopp 943650
--- 3140,3154 ----
Karsten Hopp 943650
  
Karsten Hopp 943650
      /* Add required procsets - NOTE: order is important! */
Karsten Hopp 943650
      if (!prt_add_resource(res_prolog))
Karsten Hopp 943650
! 	goto theend;
Karsten Hopp 943650
  #ifdef FEAT_MBYTE
Karsten Hopp 943650
      if (prt_out_mbyte)
Karsten Hopp 943650
      {
Karsten Hopp 943650
  	/* Add CID font procset, and any user supplied CMap */
Karsten Hopp 943650
  	if (!prt_add_resource(res_cidfont))
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
  	if (prt_custom_cmap && !prt_add_resource(res_cmap))
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
      }
Karsten Hopp 943650
  #endif
Karsten Hopp 943650
  
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 3158,3164 ****
Karsten Hopp 943650
  	/* There will be only one Roman font encoding to be included in the PS
Karsten Hopp 943650
  	 * file. */
Karsten Hopp 943650
  	if (!prt_add_resource(res_encoding))
Karsten Hopp 943650
! 	    return FALSE;
Karsten Hopp 943650
  
Karsten Hopp 943650
      prt_dsc_noarg("EndProlog");
Karsten Hopp 943650
  
Karsten Hopp 943650
--- 3158,3164 ----
Karsten Hopp 943650
  	/* There will be only one Roman font encoding to be included in the PS
Karsten Hopp 943650
  	 * file. */
Karsten Hopp 943650
  	if (!prt_add_resource(res_encoding))
Karsten Hopp 943650
! 	    goto theend;
Karsten Hopp 943650
  
Karsten Hopp 943650
      prt_dsc_noarg("EndProlog");
Karsten Hopp 943650
  
Karsten Hopp 943650
*** ../vim-7.4.532/src/version.c	2014-11-27 17:29:52.770188864 +0100
Karsten Hopp 943650
--- src/version.c	2014-11-27 17:32:56.636171921 +0100
Karsten Hopp 943650
***************
Karsten Hopp 943650
*** 743,744 ****
Karsten Hopp 943650
--- 743,746 ----
Karsten Hopp 943650
  {   /* Add new patch number below this line */
Karsten Hopp 943650
+ /**/
Karsten Hopp 943650
+     533,
Karsten Hopp 943650
  /**/
Karsten Hopp 943650
Karsten Hopp 943650
-- 
Karsten Hopp 943650
People who want to share their religious views with you
Karsten Hopp 943650
almost never want you to share yours with them.
Karsten Hopp 943650
Karsten Hopp 943650
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 943650
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 943650
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 943650
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///