Re: About REP_TEXT_MUSTBEFREED (ITS#6138)

Howard Chu <[email protected]> Fri, 30 Jul 2021 16:58:08 +0100
Newsgroups gmane.network.openldap.devel
Message-ID <[email protected]>
Hallvard Breien Furuseth wrote:
> REP_TEXT_MUSTBEFREED looks like a bad idea, at lest for now:
> Errors can happen anywhere, and then sr_text is usually set
> to a string constant.  If REP_TEXT_MUSTBEFREED is already set,
> slapd will then later try to free that constant.
> 
> To add this flag, first add result.c:rs_replace_text() or
> something similar, like rs_replace_entry(). Modify all code
> which modifies sr_text to use this function/macro, and
> encourage 3rd party code to do the same.
> 
> Also look at code which copies a SlapReply.
> 
> Each REP_*_MUSTBEFREED flag and its related data should be
> managed by a similar function/macro, really.

Good point. Too much trouble for now, I'm going to revert this.
> 
> (I tried to add a comment in Github, but that didn't
> seem to work, so mailing here instead.)
> 


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/