Question on lp_load() and smb_iconv_open()

Alexander Bokovoy ab at samba.org
Thu May 1 11:03:25 GMT 2008


2008/5/1, Brad Hards <bradh at frogmouth.net>:
> source/param/loadparm.c, line 2477 (in lp_load()) calls smb_iconv_open() (in
>  lib/charset/iconv.c). That ends up calling the system iconv_open().
>
>  There is a smb_iconv_close() function (which calls the system iconv_close())
>  to clean up. However loadparm.c doesn't appear to call it. It doesn't even
>  store the
>
>  I'm not sure how to fix this. The easiest way would appear to be some kind of
>  lp_unload() that gets the smb_iconv_t back from the lib/util/dprintf.c static
>  variable, and then calls smb_iconv_close().
>
>  Comments, suggestions, or patches most welcome...
What about allocating it on some global context and set destructor to
that structure to call smb_iconv_close()? This way it will be closed
automatically when global context is destroyed.
-- 
/ Alexander Bokovoy


More information about the samba-technical mailing list