aboutsummaryrefslogtreecommitdiffstats
path: root/main/bc/bc-1.06.95-memory_leak-1.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-05-05 06:09:33 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-05-05 06:09:54 +0000
commit32411a06d55a03ca18ecf8fe85799f2efe92cbca (patch)
treefb88236ff88df1639e1ee165ce512a220fde7edb /main/bc/bc-1.06.95-memory_leak-1.patch
parentbffa702b79d57679ac28e1ec73722a90fcdccea4 (diff)
downloadaports-32411a06d55a03ca18ecf8fe85799f2efe92cbca.tar.bz2
aports-32411a06d55a03ca18ecf8fe85799f2efe92cbca.tar.xz
main/bc: fix memleak
patch from gentoo
Diffstat (limited to 'main/bc/bc-1.06.95-memory_leak-1.patch')
-rw-r--r--main/bc/bc-1.06.95-memory_leak-1.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/main/bc/bc-1.06.95-memory_leak-1.patch b/main/bc/bc-1.06.95-memory_leak-1.patch
new file mode 100644
index 0000000000..65703f9481
--- /dev/null
+++ b/main/bc/bc-1.06.95-memory_leak-1.patch
@@ -0,0 +1,41 @@
+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
+
+diff -Naur bc-1.06.95.orig/bc/bc.y bc-1.06.95/bc/bc.y
+--- bc-1.06.95.orig/bc/bc.y 2006-09-04 21:39:31.000000000 -0500
++++ bc-1.06.95/bc/bc.y 2014-04-09 13:27:04.602661243 -0500
+@@ -569,6 +569,7 @@
+ generate (">");
+ break;
+ }
++ free($2);
+ }
+ | expression '+' expression
+ {
+diff -Naur bc-1.06.95.orig/bc/storage.c bc-1.06.95/bc/storage.c
+--- bc-1.06.95.orig/bc/storage.c 2006-09-04 21:39:31.000000000 -0500
++++ bc-1.06.95/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;
+diff -Naur bc-1.06.95.orig/bc/util.c bc-1.06.95/bc/util.c
+--- bc-1.06.95.orig/bc/util.c 2006-09-04 21:39:31.000000000 -0500
++++ bc-1.06.95/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++;