#25 stream appender close does not clear udata - alignment trap

closed-fixed
None
5
2012-10-04
2011-01-31
Anonymous
No

In appender_type_stream.c, the stream_close function does not set the udata to NULL after closing the file. This causes a problem when a user attempts to reopen an appender against that stream as the stream_open function loads the udata, sees that it is non-NULL and returns without opening the file again.

adding:
log4c_appender_set_udata(this, NULL);
before the return statement fixed the problem, but it is probably safer/cleaner to change the return statement to be
int retval = fclose(fp);
if (!retval) {
log4c_appender_set_udata(this, NULL);
}
return retval;

Discussion

  • František Dvořák

    Fixed in CVS HEAD, used the proposed change, thanks.

     
  • František Dvořák

    • assigned_to: nobody --> valtri
    • status: open --> open-fixed
     
  • František Dvořák

    log4c-1.2.2 released.

     
  • František Dvořák

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks