Skip to content

Commit f1ae6ad

Browse files
authored
Perform the null check right after the memory allocation
Closes #876
1 parent e23ec9a commit f1ae6ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opentracing/src/ngx_http_opentracing_module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ static void *create_opentracing_main_conf(ngx_conf_t *conf) noexcept {
253253
auto main_conf = static_cast<opentracing_main_conf_t *>(
254254
ngx_pcalloc(conf->pool, sizeof(opentracing_main_conf_t)));
255255
// Default initialize members.
256-
*main_conf = opentracing_main_conf_t();
257256
if (!main_conf) return nullptr;
257+
*main_conf = opentracing_main_conf_t();
258258
return main_conf;
259259
}
260260

0 commit comments

Comments
 (0)