Skip to content

Commit

Permalink
fix the non initialized bug in StderrLogger. (facebook#12839)
Browse files Browse the repository at this point in the history
Summary:
This PR is intended to fix a potential uninitialized variable bug.

Fixes facebook#12837

Pull Request resolved: facebook#12839

Reviewed By: ajkr

Differential Revision: D59398888

Pulled By: cbi42

fbshipit-source-id: 337391d7c1e73c0ff61797f88fbb4a8379500211
  • Loading branch information
wqshr12345 authored and facebook-github-bot committed Jul 8, 2024
1 parent 110ce5f commit f471e56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/stderr_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace ROCKSDB_NAMESPACE {
class StderrLogger : public Logger {
public:
explicit StderrLogger(const InfoLogLevel log_level = InfoLogLevel::INFO_LEVEL)
: Logger(log_level), log_prefix(nullptr) {}
: Logger(log_level), log_prefix(nullptr), log_prefix_len(0) {}
explicit StderrLogger(const InfoLogLevel log_level, const std::string prefix)
: Logger(log_level),
log_prefix(strdup(prefix.c_str())),
Expand Down

0 comments on commit f471e56

Please sign in to comment.