in reply to Re: [Ceph::RADOS] Help Debugging Inline C
in thread [Ceph::RADOS] Help Debugging Inline C

Using Newx (a malloc) will just leak the memory

How would that happen ? Surely the allocated memory is being freed (Safefree(b)) before the function returns ?

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: [Ceph::RADOS] Help Debugging Inline C
by oiskuu (Hermit) on Nov 08, 2013 at 02:35 UTC
    You are trying to free b which points somewhere into the allocated buffer. I hope you do make use of malloc debuggers :-)

    Also, if rados_pool_list() returned negative, you'd be allocating 4GB chunks something bogus (not sure what casts and/or checks are involved).

    Like I said, the rados code seems to be in flux. Take a look at librados.cc. Looks messy to me.

      You are trying to free b which points somewhere into the allocated buffer

      Duh!! ... of course ... thanks.

      Cheers,
      Rob.