wok-next diff bc/stuff/bc-1.06.95-memory_leak-1.patch @ rev 19571

Up: attr, acl, libcap, shadow (added), psmisc (added), iana-etc (added), bison, flex, bc, libtool, gdbm. Extra: help2man, perl-locale-gettext.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Dec 23 03:55:33 2016 +0200 (2016-12-23)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/bc/stuff/bc-1.06.95-memory_leak-1.patch	Fri Dec 23 03:55:33 2016 +0200
     1.3 @@ -0,0 +1,41 @@
     1.4 +Submitted By: Bruce Dubbs (bdubbs at linuxfromscratch dot org)
     1.5 +Date: 2014-04-18
     1.6 +Initial Package Version: 1.06.95
     1.7 +Origin: Gentoo
     1.8 +Description: Fixes memory leaks and an uninitialized variable
     1.9 + 
    1.10 +diff -Naur bc-1.06.95.orig/bc/bc.y bc-1.06.95/bc/bc.y
    1.11 +--- bc-1.06.95.orig/bc/bc.y	2006-09-04 21:39:31.000000000 -0500
    1.12 ++++ bc-1.06.95/bc/bc.y	2014-04-09 13:27:04.602661243 -0500
    1.13 +@@ -569,6 +569,7 @@
    1.14 + 				    generate (">");
    1.15 + 				  break;
    1.16 + 				}
    1.17 ++			        free($2);	
    1.18 + 			    }
    1.19 + 			| expression '+' expression
    1.20 + 			    {
    1.21 +diff -Naur bc-1.06.95.orig/bc/storage.c bc-1.06.95/bc/storage.c
    1.22 +--- bc-1.06.95.orig/bc/storage.c	2006-09-04 21:39:31.000000000 -0500
    1.23 ++++ bc-1.06.95/bc/storage.c	2014-04-09 13:28:11.770763410 -0500
    1.24 +@@ -99,6 +99,7 @@
    1.25 +     {
    1.26 +       f = &functions[indx];
    1.27 +       f->f_defined = FALSE;
    1.28 ++      f->f_void = FALSE;
    1.29 +       f->f_body = (char *) bc_malloc (BC_START_SIZE);
    1.30 +       f->f_body_size = BC_START_SIZE;
    1.31 +       f->f_code_size = 0;
    1.32 +diff -Naur bc-1.06.95.orig/bc/util.c bc-1.06.95/bc/util.c
    1.33 +--- bc-1.06.95.orig/bc/util.c	2006-09-04 21:39:31.000000000 -0500
    1.34 ++++ bc-1.06.95/bc/util.c	2014-04-09 13:27:39.841190064 -0500
    1.35 +@@ -602,8 +602,7 @@
    1.36 +     case FUNCTDEF:
    1.37 +       if (id->f_name != 0)
    1.38 + 	{
    1.39 +-	  if (namekind != FUNCT)
    1.40 +-	    free(name);
    1.41 ++	  free(name);
    1.42 + 	  /* Check to see if we are redefining a math lib function. */ 
    1.43 + 	  if (use_math && namekind == FUNCTDEF && id->f_name <= 6)
    1.44 + 	    id->f_name = next_func++;