Skip to content

Commit

Permalink
Close Unicode resources on exit
Browse files Browse the repository at this point in the history
Suggested-by: valgrind
See-also: #6
  • Loading branch information
pabs3 committed Sep 17, 2023
1 parent 6de8b15 commit a8b1727
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/libpst.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ int pst_reopen(pst_file *pf) {

int pst_close(pst_file *pf) {
DEBUG_ENT("pst_close");
pst_unicode_close();
if (!pf) {
DEBUG_RET();
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/vbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ static size_t sbcs_conversion(pst_vbuf *dest, const char *inbuf, int iblen, icon
}


static void pst_unicode_close();
static void pst_unicode_close()
void pst_unicode_close();
void pst_unicode_close()
{
iconv_close(i16to8);
if (target_open_from) iconv_close(i8totarget);
Expand Down
1 change: 1 addition & 0 deletions src/vbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void pst_vbgrow(pst_vbuf *vb, size_t len); // grow buffer by len bytes,
void pst_vbset(pst_vbuf *vb, void *data, size_t len);
void pst_vbappend(pst_vbuf *vb, void *data, size_t length);
void pst_unicode_init();
void pst_unicode_close();
size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen);
size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
Expand Down

0 comments on commit a8b1727

Please sign in to comment.