fix memory leak

This commit is contained in:
deepak1556 2015-06-08 19:56:48 +05:30
parent 15255944b6
commit 2ba119f395

View file

@ -51,7 +51,8 @@ NetLog::NetLog(net::URLRequestContext* context)
<< "for net logging";
} else {
std::string json;
base::JSONWriter::Write(GetConstants(), &json);
scoped_ptr<base::Value> constants(GetConstants());
base::JSONWriter::Write(constants.get(), &json);
fprintf(log_file_.get(), "{\"constants\": %s, \n", json.c_str());
fprintf(log_file_.get(), "\"events\": [\n");