Skip to content

Commit

Permalink
fix leak counter error when freeing a NULL mustache object
Browse files Browse the repository at this point in the history
  • Loading branch information
boazsegev committed May 6, 2024
1 parent c542a66 commit c06ec0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fio-stl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20733,6 +20733,8 @@ SFUNC fio_mustache_s *fio_mustache_load FIO_NOOP(fio_mustache_load_args_s a) {

/* Frees the mustache template object (or reduces it's reference count). */
SFUNC void fio_mustache_free(fio_mustache_s *m) {
if (!m)
return;
FIO_LEAK_COUNTER_ON_FREE(fio_mustache_s);
fio_bstr_free((char *)m);
}
Expand Down
2 changes: 2 additions & 0 deletions fio-stl/104 mustache.h
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,8 @@ SFUNC fio_mustache_s *fio_mustache_load FIO_NOOP(fio_mustache_load_args_s a) {

/* Frees the mustache template object (or reduces it's reference count). */
SFUNC void fio_mustache_free(fio_mustache_s *m) {
if (!m)
return;
FIO_LEAK_COUNTER_ON_FREE(fio_mustache_s);
fio_bstr_free((char *)m);
}
Expand Down

0 comments on commit c06ec0b

Please sign in to comment.