Now that I've replied to your last message, I think I've spotted the bug:

-[ Tue, Oct 25, 2011 at 08:34:23PM +0000, Whitlock, Bradley D ]----
> {
>   // Storage for temporary string
>   char* s = NULL;
>   scm_dynwind_begin (0);
>   scm_dynwind_unwind_handler (free, s, SCM_F_WIND_EXPLICITLY);
> 
>   s = scm_to_locale_string (scm_val);
> 
>   fstWriterEmitValueChange(SCM_TO_CTX (scm_ctx),
>                                                    SCM_TO_FSTHANDLE 
> (scm_fsthandle),
>                                                    s_buf);
> 
>   scm_dynwind_end();
> 
>   return SCM_UNSPECIFIED;
> }

Here you are calling scm_dynwind_unwind_handler with NULL (the current
value of s), which is useless. It will call free(NULL) to free s, which
is not very usefull.
You must move this call after the initialization of s (and, as
suggested, you'd better use scm_dynwind_free, which is equivalent to
scm_dynwind_unwind_handler(free)).


Reply via email to