diff --git a/Fix-allocated-memory-not-released.patch b/Fix-allocated-memory-not-released.patch new file mode 100644 index 0000000000000000000000000000000000000000..5b4b8398c665f3c7bed6961913bf6315d85ebec2 --- /dev/null +++ b/Fix-allocated-memory-not-released.patch @@ -0,0 +1,44 @@ +From c3dc7294670c91af89e0122c6979de70c63ce4f7 Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Sat, 18 Jun 2022 17:35:35 +0300 +Subject: Fix https://puszcza.gnu.org.ua/bugs/index.php?563 + +--- + src/gdbmshell.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/gdbmshell.c b/src/gdbmshell.c +index 12fc2bd..4ab2660 100644 +--- a/src/gdbmshell.c ++++ b/src/gdbmshell.c +@@ -1232,6 +1232,7 @@ snapshot_handler (struct command_param *param, struct command_environ *cenv) + char *sb = tildexpand (PARAM_STRING (param, 1)); + char const *sel; + int rc = gdbm_latest_snapshot (sa, sb, &sel); ++ int res; + + if (rc >= 0 && rc < ARRAY_SIZE (snapshot_status_info)) + { +@@ -1243,13 +1244,17 @@ snapshot_handler (struct command_param *param, struct command_environ *cenv) + snapshot_status_info[rc].fn (cenv->fp, sa, sb); + if (rc == GDBM_SNAPSHOT_OK) + print_snapshot (sel, cenv->fp); ++ res = GDBMSHELL_OK; + } + else + { + terror (_("unexpected error code: %d"), rc); +- return GDBMSHELL_ERR; ++ res = GDBMSHELL_ERR; + } +- return GDBMSHELL_OK; ++ ++ free (sa); ++ free (sb); ++ return res; + } + + +-- +2.36.1 + diff --git a/gdbm.spec b/gdbm.spec index f9b7578fc345b868d27244f6bece0d2c98ede0a7..5b72c355d03bde84bfeaf6cf193351ac0799437e 100644 --- a/gdbm.spec +++ b/gdbm.spec @@ -1,6 +1,6 @@ Name: gdbm Version: 1.22 -Release: 9 +Release: 10 Epoch: 1 Summary: A library of database functions that work similar to the standard UNIX dbm License: GPLv3+ @@ -14,6 +14,7 @@ Patch3: Fix-location-tracking-in-gdbmtool.-Fix-the-recover-c.patch Patch4: Fix-coredump-in-gdbmtool-history-command.patch Patch5: Fix-semantics-of-gdbm_load-r.patch Patch6: Improve-handling-of-u-in-gdbm_load.patch +Patch7: Fix-allocated-memory-not-released.patch BuildRequires: gcc libtool gettext readline-devel bison flex texinfo @@ -105,6 +106,9 @@ fi %{_infodir}/*.info* %changelog +* Tue Aug 30 2022 yangchenguang - 1:1.22-10 +- DESC: Fix allocated memory not released + * Tue Jul 5 2022 wangzhqiang - 1:1.22-9 - DESC: Improve handling of -u in gdbm_load