Skip to content

Commit 827c1cc

Browse files
committed
Fix potential Null pointer dereference in extract_vbucket_conf.cc
1 parent 477033f commit 827c1cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/evmc/extract_vbucket_conf.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ void GetVbucketConf::OnHttpReqDone(struct evhttp_request* req, void* arg) {
4545
int GetVbucketConf::GetRemoteVbucketConf(const std::string& conf_addr, std::string& context) {
4646
evpp::httpc::URLParser url(conf_addr);
4747
struct event_base* base = event_base_new();
48+
if (base == NULL) {
49+
return -1;
50+
}
4851
struct evhttp_connection* conn = evhttp_connection_base_new(base, nullptr, url.host.c_str(), url.port);
4952
HttpReqDoneArg arg;
5053
arg.event = base;

0 commit comments

Comments
 (0)