Skip to content

Commit 3d2a6f4

Browse files
authored
Fix leak and update actions (#24)
* 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
1 parent 8a9c9c1 commit 3d2a6f4

9 files changed

Lines changed: 52 additions & 26 deletions

File tree

.github/workflows/check-latest.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
4+
name: Build (Latest ecCodes)
5+
36
on:
47
push:
58
branches: [main]
69
pull_request:
710
branches: [main]
811

9-
name: Build (Latest ecCodes)
12+
concurrency:
13+
group: ${{ github.workflow}}-${{ github.head_ref }}
14+
cancel-in-progress: true
1015

1116
jobs:
1217
R-CMD-check:
@@ -28,7 +33,7 @@ jobs:
2833
ECCODES_VERSION: 2.29.0
2934

3035
steps:
31-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
3237

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

.github/workflows/check-minimum.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
4+
name: Build (Minimum ecCodes)
5+
36
on:
47
push:
58
branches: [main]
69
pull_request:
710
branches: [main]
811

9-
name: Build (Minimum ecCodes)
12+
concurrency:
13+
group: ${{ github.workflow}}-${{ github.head_ref }}
14+
cancel-in-progress: true
1015

1116
jobs:
1217
R-CMD-check:
@@ -28,7 +33,7 @@ jobs:
2833
ECCODES_VERSION: 2.19.0
2934

3035
steps:
31-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
3237

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

.github/workflows/check-standard.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
4+
name: Build (System ecCodes)
5+
36
on:
47
push:
58
branches: [main]
69
pull_request:
710
branches: [main]
811

9-
name: Build (System ecCodes)
12+
concurrency:
13+
group: ${{ github.workflow}}-${{ github.head_ref }}
14+
cancel-in-progress: true
1015

1116
jobs:
1217
R-CMD-check:
@@ -28,7 +33,7 @@ jobs:
2833
R_KEEP_PKG_SOURCE: yes
2934

3035
steps:
31-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
3237

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

.github/workflows/lint.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
4+
name: Lint
5+
36
on:
47
push:
58
branches: [main]
69
pull_request:
710
branches: [main]
811

9-
name: Lint
12+
concurrency:
13+
group: ${{ github.workflow}}-${{ github.head_ref }}
14+
cancel-in-progress: true
1015

1116
jobs:
1217
lint:
1318
runs-on: ubuntu-latest
1419
env:
1520
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1621
steps:
17-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
1823

1924
- uses: r-lib/actions/setup-r@v2
2025
with:

.github/workflows/test-coverage.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
4+
name: Codecov
5+
36
on:
47
push:
58
branches: [main]
69
pull_request:
710
branches: [main]
811

9-
name: Codecov
12+
concurrency:
13+
group: ${{ github.workflow}}-${{ github.head_ref }}
14+
cancel-in-progress: true
1015

1116
jobs:
1217
test-coverage:
@@ -15,7 +20,7 @@ jobs:
1520
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1621

1722
steps:
18-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
1924

2025
- uses: r-lib/actions/setup-r@v2
2126
with:

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: gribr
22
Type: Package
33
Title: Read GRIB Files
4-
Version: 1.2.5
5-
Date: 2023-04-02
4+
Version: 1.2.6
5+
Date: 2023-07-10
66
Author: Nathan Wendt <nathan.wendt@noaa.gov>
77
Maintainer: Nathan Wendt <nathan.wendt@noaa.gov>
88
BugReports: https://github.com/nawendt/gribr/issues

configure

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for gribr 1.2.5.
3+
# Generated by GNU Autoconf 2.71 for gribr 1.2.6.
44
#
55
# Report bugs to <nathan.wendt@noaa.gov>.
66
#
@@ -610,8 +610,8 @@ MAKEFLAGS=
610610
# Identity of this package.
611611
PACKAGE_NAME='gribr'
612612
PACKAGE_TARNAME='gribr'
613-
PACKAGE_VERSION='1.2.5'
614-
PACKAGE_STRING='gribr 1.2.5'
613+
PACKAGE_VERSION='1.2.6'
614+
PACKAGE_STRING='gribr 1.2.6'
615615
PACKAGE_BUGREPORT='nathan.wendt@noaa.gov'
616616
PACKAGE_URL=''
617617

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

13231323
if test -n "$ac_init_help"; then
13241324
case $ac_init_help in
1325-
short | recursive ) echo "Configuration of gribr 1.2.5:";;
1325+
short | recursive ) echo "Configuration of gribr 1.2.6:";;
13261326
esac
13271327
cat <<\_ACEOF
13281328
@@ -1406,7 +1406,7 @@ fi
14061406
test -n "$ac_init_help" && exit $ac_status
14071407
if $ac_init_version; then
14081408
cat <<\_ACEOF
1409-
gribr configure 1.2.5
1409+
gribr configure 1.2.6
14101410
generated by GNU Autoconf 2.71
14111411
14121412
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1624,7 +1624,7 @@ cat >config.log <<_ACEOF
16241624
This file contains any messages produced by compilers while
16251625
running configure, to aid debugging if configure makes a mistake.
16261626
1627-
It was created by gribr $as_me 1.2.5, which was
1627+
It was created by gribr $as_me 1.2.6, which was
16281628
generated by GNU Autoconf 2.71. Invocation command line was
16291629
16301630
$ $0$ac_configure_args_raw
@@ -2295,9 +2295,9 @@ if test -z "${R_HOME}"; then
22952295
exit 1
22962296
fi
22972297

2298-
#RBIN="${R_HOME}/bin/R"
2299-
#CC=`"${RBIN}" CMD config CC`;
2300-
#CPPFLAGS=`"${RBIN}" CMD config CPPFLAGS`
2298+
RBIN="${R_HOME}/bin/R"
2299+
CC=`"${RBIN}" CMD config CC`;
2300+
CPPFLAGS=`"${RBIN}" CMD config CPPFLAGS`
23012301

23022302
# Compiler checks
23032303

@@ -4235,7 +4235,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
42354235
# report actual input values of CONFIG_FILES etc. instead of their
42364236
# values after options handling.
42374237
ac_log="
4238-
This file was extended by gribr $as_me 1.2.5, which was
4238+
This file was extended by gribr $as_me 1.2.6, which was
42394239
generated by GNU Autoconf 2.71. Invocation command line was
42404240
42414241
CONFIG_FILES = $CONFIG_FILES
@@ -4290,7 +4290,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
42904290
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
42914291
ac_cs_config='$ac_cs_config_escaped'
42924292
ac_cs_version="\\
4293-
gribr config.status 1.2.5
4293+
gribr config.status 1.2.6
42944294
configured by $0, generated by GNU Autoconf 2.71,
42954295
with options \\"\$ac_cs_config\\"
42964296

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([gribr],[1.2.5],[nathan.wendt@noaa.gov])
1+
AC_INIT([gribr],[1.2.6],[nathan.wendt@noaa.gov])
22

33
AC_CONFIG_MACRO_DIR([tools/m4])
44

src/grib_get_message.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ SEXP gribr_grib_get_message(SEXP gribr_fileHandle, SEXP gribr_messages, SEXP gri
6565
}
6666

6767
if ((p_gribr_messages[n] - 1) == i) {
68-
SET_VECTOR_ELT(gribr_message, n++,gribr_message_from_handle(h));
68+
SET_VECTOR_ELT(gribr_message, n++, gribr_message_from_handle(h));
6969
}
70+
codes_handle_delete(h);
7071
}
7172
} else {
7273
if (p_gribr_messages[0] < 1 || (p_gribr_messages[0] - 1) >= count) {

0 commit comments

Comments
 (0)