Blame SOURCES/7.4.533

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