gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4377-g80de2f7c


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4377-g80de2f7c
Date: Tue, 22 Feb 2022 13:12:47 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.1-stable has been updated
       via  80de2f7c9bc519fb820033a530e1657977117a33 (commit)
      from  938afb4d7acb9974d5789dfe4e322c0ccce0541e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=80de2f7c9bc519fb820033a530e1657977117a33

commit 80de2f7c9bc519fb820033a530e1657977117a33
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Tue Feb 22 20:12:28 2022 +0200

    Fix resource links found by Coverity.

diff --git a/ChangeLog b/ChangeLog
index ce603e94..f20dd21f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-02-22         Arnold D. Robbins     <arnold@skeeve.com>
+
+       Fix resource links found by Coverity. Thanks to
+       Jakub Martisko <jamartis@redhat.com> for the report.
+
+       * ext.c (make_builtin): Free install_name before returning.
+       * io.c (remap_std_file): Unconditionally close newfd.
+       * symbol.c (load_symbols): Unref built_in also.
+
 2022-12-10         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 
        * io.c (wait_any): When saving a saved exit status returned by
diff --git a/ext.c b/ext.c
index 5815c739..e5b6a2a0 100644
--- a/ext.c
+++ b/ext.c
@@ -128,6 +128,7 @@ make_builtin(const char *name_space, const awk_ext_func_t 
*funcinfo)
                        /* multiple extension() calls etc. */
                        if (do_lint)
                                lintwarn(_("make_builtin: function `%s' already 
defined"), name);
+                       free(install_name);
                        return awk_false;
                } else
                        /* variable name etc. */
diff --git a/extension/ChangeLog b/extension/ChangeLog
index fc90156f..69896748 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,10 @@
+2022-02-22         Arnold D. Robbins     <arnold@skeeve.com>
+
+       Fix resource links found by Coverity. Thanks to
+       Jakub Martisko <jamartis@redhat.com> for the report.
+
+       * readfile.c (do_readfile): Close fd if text == NULL.
+
 2021-12-10         Arnold D. Robbins     <arnold@skeeve.com>
 
        * rwarray.c (write_number, read_number): Reformat comments a bit.
diff --git a/extension/readfile.c b/extension/readfile.c
index 6c3307cd..def414ee 100644
--- a/extension/readfile.c
+++ b/extension/readfile.c
@@ -121,8 +121,10 @@ do_readfile(int nargs, awk_value_t *result, struct 
awk_ext_func *unused)
                }
 
                text = read_file_to_buffer(fd, & sbuf);
-               if (text == NULL)
+               if (text == NULL) {
+                       close(fd);
                        goto done;      /* ERRNO already updated */
+               }
 
                close(fd);
                make_malloced_string(text, sbuf.st_size, result);
diff --git a/io.c b/io.c
index 07d83689..cf54cdd4 100644
--- a/io.c
+++ b/io.c
@@ -628,8 +628,8 @@ remap_std_file(int oldfd)
        if (newfd >= 0) {
                /* if oldfd is open, dup2() will close oldfd for us first. */
                ret = dup2(newfd, oldfd);
-               if (ret == 0)
-                       close(newfd);
+               // close unconditionally, calling code assumes it
+               close(newfd);
        } else
                ret = 0;
 
diff --git a/symbol.c b/symbol.c
index 300fa871..b89c01e0 100644
--- a/symbol.c
+++ b/symbol.c
@@ -644,6 +644,7 @@ load_symbols()
        unref(scalar);
        unref(untyped);
        unref(array);
+       unref(built_in);
 }
 
 /* check_param_names --- make sure no parameter is the name of a function */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            | 9 +++++++++
 ext.c                | 1 +
 extension/ChangeLog  | 7 +++++++
 extension/readfile.c | 4 +++-
 io.c                 | 4 ++--
 symbol.c             | 1 +
 6 files changed, 23 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]