[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Fixing slapo-nops (ITS#8759)



Emmanuel Dreyfus wrote:
Hello

Following ITS#8759, I am looking for ideas about how to fix slapo-nops.

This overlays suppress nilpotent operations that replace an attribute
values by the same values.  The code is in
contrib/slapd-modules/nops/nops.c

The problem is that slapo-nops assumes it can free the nilpotent struct
Modifications after removing them from the list, but for instande
slapo-memberof uses struct Modifications allocated on the stack.

Not freeing in slapo-nops is not a fix, since unlinked struct
Modifications will not be freed anywhere else, and we will get a memory
leak.

Would it make sense to add a SLAP_MOD_ONSTACK flag in struct
Modification's sm_flags so that we can tell the difference? Any other
idea?

That sounds reasonable, sure.

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