[Bro-Dev] #485: Error when defining vectors of records with optional fields

Bro Tracker bro at tracker.bro-ids.org
Mon Aug 15 21:10:20 PDT 2011

#485: Error when defining vectors of records with optional fields
  Reporter:  vallenti       |      Owner:  robin
      Type:  Merge Request  |     Status:  assigned
  Priority:  Normal         |  Milestone:  Bro1.6
 Component:  Bro            |    Version:  git/master
Resolution:                 |   Keywords:

Comment (by robin):

 >  Unless git is pulling a trick on me, that change I made looks like it's
 >  master now and didn't get reverted?

 Indeed. Don't ask me where my change went, I must have lost it

 >  the caller), then it gets unref'd right after the assignment resulting
 >  no more refs for that val.

 The right fix is to remove the Unref. Eval() returns the +1 refcount,
 which the Assign() takes ownership of, so no Unref() necessary.

 To answer your earlier question, there's no documentation on the
 ref-counting and it's generally also not consistent unfortunately
 whether caller or callee are expected to do the increments/decrements.
 If I were granted just one wish about Bro's C++ code, I'd get rid of
 the explicit reference counting ...

Ticket URL: <http://tracker.bro-ids.org/bro/ticket/485#comment:9>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list