From 4f1d8d2d1f8e35b84544a6b15625c62ccaf150eb Mon Sep 17 00:00:00 2001 From: Zhilin Huang Date: Mon, 27 Feb 2017 17:03:00 +0800 Subject: [PATCH] reconstruct to load the default value for member variables --- proxy/ControlMatcher.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/ControlMatcher.cc b/proxy/ControlMatcher.cc index a49f85439a5..7981bf02125 100644 --- a/proxy/ControlMatcher.cc +++ b/proxy/ControlMatcher.cc @@ -219,7 +219,7 @@ HostMatcher::NewEntry(matcher_line *line_info) error = cur_d->Init(line_info); if (error.failed()) { // There was a problem so undo the effects this function - memset(cur_d, 0, sizeof(Data)); + new (cur_d) Data(); // reconstruct } else { // Fill in the matching info host_lookup->NewEntry(match_data, (line_info->type == MATCH_DOMAIN) ? true : false, cur_d);