star-hitran

Load line-by-line data from the HITRAN database
git clone git://git.meso-star.fr/star-hitran.git
Log | Files | Refs | README | LICENSE

commit 81407cedf36c48fffc78494f58e78a8f96709818
parent 47b05af5ed5bb064aa0f7e4b9b4aab1014a934aa
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 23 May 2022 12:20:58 +0200

Fix a possible memory leak on the deserialisation of isotope metadata

Diffstat:
Msrc/shtr_isotope_metadata.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/shtr_isotope_metadata.c b/src/shtr_isotope_metadata.c @@ -713,6 +713,8 @@ shtr_isotope_metadata_create_from_stream } else { \ res = RES_UNKNOWN_ERR; \ } \ + log_err(shtr, "%s: error reading isotope metadata -- %s.\n", \ + FUNC_NAME, res_to_cstr(res)); \ goto error; \ } \ } (void)0 @@ -720,7 +722,7 @@ shtr_isotope_metadata_create_from_stream if(version != SHTR_ISOTOPE_METADATA_VERSION) { log_err(shtr, "%s: unexpected isotope metadata version %d. " - "Experting a isotope metadata in version %d.\n", + "Expecting a isotope metadata in version %d.\n", FUNC_NAME, version, SHTR_ISOTOPE_METADATA_VERSION); res = RES_BAD_ARG; goto error; @@ -738,6 +740,10 @@ exit: if(out_metadata) *out_metadata = metadata; return res; error: + if(metadata) { + SHTR(isotope_metadata_ref_put(metadata)); + metadata = NULL; + } goto exit; }