Skip to content

Commit

Permalink
rgw: Initialize pointer field in seed
Browse files Browse the repository at this point in the history
Fixes the Coverity Scan Report:
CID 1396116: Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member create_date is not initialized in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member s is not initialized in this constructor nor in any functions that it calls.
6. uninit_member: Non-static class member store is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <jcollin@redhat.com>
  • Loading branch information
joscollin committed Jul 12, 2017
1 parent 213db6e commit f3d5e33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rgw/rgw_torrent.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ class seed

string announce; // tracker
string origin; // origin
time_t create_date; // time of the file created
time_t create_date{0}; // time of the file created
string comment; // comment
string create_by; // app name and version
string encoding; // if encode use gbk rather than gtf-8 use this field
uint64_t sha_len; // sha1 length
bool is_torrent; // flag
bufferlist bl; // bufflist ready to send

struct req_state *s;
RGWRados *store;
struct req_state *s{nullptr};
RGWRados *store{nullptr};
SHA1 h;

TorrentBencode dencode;
Expand Down

0 comments on commit f3d5e33

Please sign in to comment.