Skip to content

Commit 8d03d8b

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

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/evmc/extract_vbucket_conf.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ 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);
52+
if (conn == NULL) {
53+
return -1;
54+
}
4955
HttpReqDoneArg arg;
5056
arg.event = base;
5157
arg.retstr = &context;

0 commit comments

Comments
 (0)