diff options
Diffstat (limited to 'dev-cpp')
-rw-r--r-- | dev-cpp/libmcpp/0001-Fix-memory-leaks.patch | 28 | ||||
-rw-r--r-- | dev-cpp/libmcpp/0002-Fix-more-memory-leaks.patch | 48 |
2 files changed, 76 insertions, 0 deletions
diff --git a/dev-cpp/libmcpp/0001-Fix-memory-leaks.patch b/dev-cpp/libmcpp/0001-Fix-memory-leaks.patch new file mode 100644 index 0000000..bb1be6b --- /dev/null +++ b/dev-cpp/libmcpp/0001-Fix-memory-leaks.patch @@ -0,0 +1,28 @@ +From dffd7e8425064b22e6679070d216c108aef88304 Mon Sep 17 00:00:00 2001 +From: Dan Goodliffe <dan@randomdan.homeip.net> +Date: Mon, 14 Dec 2020 11:26:14 +0000 +Subject: [PATCH 1/2] Fix memory leaks + +--- + src/main.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/main.c b/src/main.c +index f9ede32..279cbbe 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -428,8 +428,11 @@ int main + + fatal_error_exit: + #if MCPP_LIB ++ if (in_file != stdin_name) ++ free( in_file); + clear_filelist(); + clear_symtable(); ++ init_system(); + #endif + + if (fp_in && fp_in != stdin) +-- +2.29.2 + diff --git a/dev-cpp/libmcpp/0002-Fix-more-memory-leaks.patch b/dev-cpp/libmcpp/0002-Fix-more-memory-leaks.patch new file mode 100644 index 0000000..5562d83 --- /dev/null +++ b/dev-cpp/libmcpp/0002-Fix-more-memory-leaks.patch @@ -0,0 +1,48 @@ +From 201d241a756d08598bec52c044abd03bcaf2b093 Mon Sep 17 00:00:00 2001 +From: Dan Goodliffe <dan@randomdan.homeip.net> +Date: Mon, 14 Dec 2020 11:56:33 +0000 +Subject: [PATCH 2/2] Fix more memory leaks + +--- + src/main.c | 4 ++++ + src/system.c | 2 ++ + 2 files changed, 6 insertions(+) + +diff --git a/src/main.c b/src/main.c +index 279cbbe..114b612 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -433,6 +433,10 @@ fatal_error_exit: + clear_filelist(); + clear_symtable(); + init_system(); ++ init_support(); ++ init_eval(); ++ init_directive(); ++ init_main(); + #endif + + if (fp_in && fp_in != stdin) +diff --git a/src/system.c b/src/system.c +index 91b513e..1ac380a 100644 +--- a/src/system.c ++++ b/src/system.c +@@ -3176,6 +3176,7 @@ found_name: + if (open_include( filename, (delim == '"'), next)) { + /* 'fname' should not be free()ed, it is used as file-> */ + /* real_fname and has been registered into fnamelist[] */ ++ free( filename); + return TRUE; + } + +@@ -3511,6 +3512,7 @@ search: + put_depend( fullname); /* Output dependency line */ + + true: ++ free( fullname); + return TRUE; + false: + free( fullname); +-- +2.29.2 + |