Skip to content

Commit

Permalink
Fix potential Null pointer dereference in extract_vbucket_conf.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
icy17 committed Apr 10, 2024
1 parent 477033f commit 8d03d8b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/evmc/extract_vbucket_conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ void GetVbucketConf::OnHttpReqDone(struct evhttp_request* req, void* arg) {
int GetVbucketConf::GetRemoteVbucketConf(const std::string& conf_addr, std::string& context) {
evpp::httpc::URLParser url(conf_addr);
struct event_base* base = event_base_new();
if (base == NULL) {
return -1;
}
struct evhttp_connection* conn = evhttp_connection_base_new(base, nullptr, url.host.c_str(), url.port);
if (conn == NULL) {
return -1;
}
HttpReqDoneArg arg;
arg.event = base;
arg.retstr = &context;
Expand Down

0 comments on commit 8d03d8b

Please sign in to comment.