From 7e4b7627c34e7df30b44de47f9a175a55d1ffdcc Mon Sep 17 00:00:00 2001 From: jbu Date: Wed, 13 May 2015 13:59:17 +0200 Subject: [PATCH] bc: fix memory leak patch from LFS --- .../bc/patches/bc-1.06.95-memory_leak-1.patch | 38 +++++++++++++++++++ srcpkgs/bc/template | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/bc/patches/bc-1.06.95-memory_leak-1.patch diff --git a/srcpkgs/bc/patches/bc-1.06.95-memory_leak-1.patch b/srcpkgs/bc/patches/bc-1.06.95-memory_leak-1.patch new file mode 100644 index 0000000000..35c7382f09 --- /dev/null +++ b/srcpkgs/bc/patches/bc-1.06.95-memory_leak-1.patch @@ -0,0 +1,38 @@ +Submitted By: Bruce Dubbs (bdubbs at linuxfromscratch dot org) +Date: 2014-04-18 +Initial Package Version: 1.06.95 +Origin: Gentoo +Description: Fixes memory leaks and an uninitialized variable + +--- bc/bc.y 2006-09-04 21:39:31.000000000 -0500 ++++ bc/bc.y 2014-04-09 13:27:04.602661243 -0500 +@@ -569,6 +569,7 @@ + generate (">"); + break; + } ++ free($2); + } + | expression '+' expression + { +--- bc/storage.c 2006-09-04 21:39:31.000000000 -0500 ++++ bc/storage.c 2014-04-09 13:28:11.770763410 -0500 +@@ -99,6 +99,7 @@ + { + f = &functions[indx]; + f->f_defined = FALSE; ++ f->f_void = FALSE; + f->f_body = (char *) bc_malloc (BC_START_SIZE); + f->f_body_size = BC_START_SIZE; + f->f_code_size = 0; +--- bc/util.c 2006-09-04 21:39:31.000000000 -0500 ++++ bc/util.c 2014-04-09 13:27:39.841190064 -0500 +@@ -602,8 +602,7 @@ + case FUNCTDEF: + if (id->f_name != 0) + { +- if (namekind != FUNCT) +- free(name); ++ free(name); + /* Check to see if we are redefining a math lib function. */ + if (use_math && namekind == FUNCTDEF && id->f_name <= 6) + id->f_name = next_func++; diff --git a/srcpkgs/bc/template b/srcpkgs/bc/template index 1ed463fb83..13ac20d3ac 100644 --- a/srcpkgs/bc/template +++ b/srcpkgs/bc/template @@ -1,7 +1,7 @@ # Template file for 'bc' pkgname=bc version=1.06.95 -revision=5 +revision=6 build_style=gnu-configure configure_args="--with-readline" hostmakedepends="flex"