Skip to content

Commit

Permalink
Fix leak and update actions (#24)
Browse files Browse the repository at this point in the history
* Fix leak and update actions

Fix leak in grib_get_message when requesting multiple messages.
codes_handle_delete was not properly called during the loop.

Updated GHA

Fixes #23
  • Loading branch information
nawendt authored Jul 10, 2023
1 parent 8a9c9c1 commit 3d2a6f4
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 26 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/check-latest.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

name: Build (Latest ecCodes)

on:
push:
branches: [main]
pull_request:
branches: [main]

name: Build (Latest ecCodes)
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
Expand All @@ -28,7 +33,7 @@ jobs:
ECCODES_VERSION: 2.29.0

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/check-minimum.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

name: Build (Minimum ecCodes)

on:
push:
branches: [main]
pull_request:
branches: [main]

name: Build (Minimum ecCodes)
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
Expand All @@ -28,7 +33,7 @@ jobs:
ECCODES_VERSION: 2.19.0

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

name: Build (System ecCodes)

on:
push:
branches: [main]
pull_request:
branches: [main]

name: Build (System ecCodes)
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
Expand All @@ -28,7 +33,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

name: Lint

on:
push:
branches: [main]
pull_request:
branches: [main]

name: Lint
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

name: Codecov

on:
push:
branches: [main]
pull_request:
branches: [main]

name: Codecov
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test-coverage:
Expand All @@ -15,7 +20,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: gribr
Type: Package
Title: Read GRIB Files
Version: 1.2.5
Date: 2023-04-02
Version: 1.2.6
Date: 2023-07-10
Author: Nathan Wendt <[email protected]>
Maintainer: Nathan Wendt <[email protected]>
BugReports: https://github.com/nawendt/gribr/issues
Expand Down
24 changes: 12 additions & 12 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for gribr 1.2.5.
# Generated by GNU Autoconf 2.71 for gribr 1.2.6.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -610,8 +610,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gribr'
PACKAGE_TARNAME='gribr'
PACKAGE_VERSION='1.2.5'
PACKAGE_STRING='gribr 1.2.5'
PACKAGE_VERSION='1.2.6'
PACKAGE_STRING='gribr 1.2.6'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1260,7 +1260,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gribr 1.2.5 to adapt to many kinds of systems.
\`configure' configures gribr 1.2.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1322,7 +1322,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gribr 1.2.5:";;
short | recursive ) echo "Configuration of gribr 1.2.6:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1406,7 +1406,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gribr configure 1.2.5
gribr configure 1.2.6
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1624,7 +1624,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gribr $as_me 1.2.5, which was
It was created by gribr $as_me 1.2.6, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -2295,9 +2295,9 @@ if test -z "${R_HOME}"; then
exit 1
fi

#RBIN="${R_HOME}/bin/R"
#CC=`"${RBIN}" CMD config CC`;
#CPPFLAGS=`"${RBIN}" CMD config CPPFLAGS`
RBIN="${R_HOME}/bin/R"
CC=`"${RBIN}" CMD config CC`;
CPPFLAGS=`"${RBIN}" CMD config CPPFLAGS`

# Compiler checks

Expand Down Expand Up @@ -4235,7 +4235,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gribr $as_me 1.2.5, which was
This file was extended by gribr $as_me 1.2.6, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4290,7 +4290,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
gribr config.status 1.2.5
gribr config.status 1.2.6
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([gribr],[1.2.5],[[email protected]])
AC_INIT([gribr],[1.2.6],[[email protected]])

AC_CONFIG_MACRO_DIR([tools/m4])

Expand Down
3 changes: 2 additions & 1 deletion src/grib_get_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ SEXP gribr_grib_get_message(SEXP gribr_fileHandle, SEXP gribr_messages, SEXP gri
}

if ((p_gribr_messages[n] - 1) == i) {
SET_VECTOR_ELT(gribr_message, n++,gribr_message_from_handle(h));
SET_VECTOR_ELT(gribr_message, n++, gribr_message_from_handle(h));
}
codes_handle_delete(h);
}
} else {
if (p_gribr_messages[0] < 1 || (p_gribr_messages[0] - 1) >= count) {
Expand Down

0 comments on commit 3d2a6f4

Please sign in to comment.