Blame SOURCES/7.4.533

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