Re: why do we delete target in RGWGetObjLayout constructed function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



yes, but target is not deleted.

2017-03-17 18:39 GMT+08:00 Jos Collin <jcollin@xxxxxxxxxx>:
> No, it won't even if target = 0. As it is unused.
>
>
> On Friday 17 March 2017 03:28 PM, liuchang0812 wrote:
>
> I saw this problem when i read RGW source code. It seems that that
> `delete` a nullptr will segment fault.
>
> code[1]:
>
> class RGWGetObjLayout : public RGWOp {
>    protected:
>         RGWRados::Object *target{nullptr};
>         RGWObjManifest *manifest{nullptr};
>         rgw_raw_obj head_obj;
>     public:
>          RGWGetObjLayout() {
>              delete target;
>    }
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux