mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-04-26 02:14:54 +02:00
fix double deallocation in text back end
This commit is contained in:
parent
c2376bf168
commit
0a8aa638f6
@ -1,4 +1,3 @@
|
|||||||
B
|
|
||||||
#+TITLE: Front end API
|
#+TITLE: Front end API
|
||||||
#+PROPERTY: comments org
|
#+PROPERTY: comments org
|
||||||
#+SETUPFILE: ../../docs/theme.setup
|
#+SETUPFILE: ../../docs/theme.setup
|
||||||
@ -3551,7 +3550,7 @@ contains
|
|||||||
|
|
||||||
end subroutine trexio_assert
|
end subroutine trexio_assert
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* File suffixes :noexport:
|
* File suffixes :noexport:
|
||||||
|
|
||||||
#+begin_src c :tangle suffix_front.h
|
#+begin_src c :tangle suffix_front.h
|
||||||
@ -3569,4 +3568,3 @@ contains
|
|||||||
#+begin_src f90 :tangle suffix_fortran.f90
|
#+begin_src f90 :tangle suffix_fortran.f90
|
||||||
end module trexio
|
end module trexio
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -499,6 +499,12 @@ trexio_text_read_$group$ (trexio_text_t* const file)
|
|||||||
// START REPEAT GROUP_DSET_STR
|
// START REPEAT GROUP_DSET_STR
|
||||||
rc = fscanf(f, "%1023s", buffer);
|
rc = fscanf(f, "%1023s", buffer);
|
||||||
assert(!((rc != 1) || (strcmp(buffer, "$group_dset$") != 0)));
|
assert(!((rc != 1) || (strcmp(buffer, "$group_dset$") != 0)));
|
||||||
|
if ((rc != 1) || (strcmp(buffer, "$group_dset$") != 0)) {
|
||||||
|
FREE(buffer);
|
||||||
|
fclose(f);
|
||||||
|
FREE($group$);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allocate arrays */
|
/* Allocate arrays */
|
||||||
if(size_$group_dset$ != 0) {
|
if(size_$group_dset$ != 0) {
|
||||||
@ -528,7 +534,6 @@ trexio_text_read_$group$ (trexio_text_t* const file)
|
|||||||
FREE(buffer);
|
FREE(buffer);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
FREE($group$->$group_dset$);
|
FREE($group$->$group_dset$);
|
||||||
FREE(tmp_$group_dset$);
|
|
||||||
FREE($group$);
|
FREE($group$);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user