From: Roger Meier Date: Sun, 4 May 2014 19:52:36 +0000 (+0200) Subject: THRIFT-2490 c_glib: if fail to read a exception from server, client may be occurred... X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=cf0edd365909ae3cc1b6afb12ed69ff6c4e8a147;p=common%2Fthrift.git THRIFT-2490 c_glib: if fail to read a exception from server, client may be occurred double free Client: c_glib Patch: Jaesang Kim --- diff --git a/compiler/cpp/src/generate/t_c_glib_generator.cc b/compiler/cpp/src/generate/t_c_glib_generator.cc index 9e3ac3c3..51952248 100644 --- a/compiler/cpp/src/generate/t_c_glib_generator.cc +++ b/compiler/cpp/src/generate/t_c_glib_generator.cc @@ -2662,6 +2662,9 @@ void t_c_glib_generator::generate_deserialize_struct(ofstream &out, indent_up(); if (allocate) { indent(out) << "g_object_unref (" << prefix << ");" << endl; + if (tstruct->is_xception()) { + indent(out) << prefix << " = NULL;" << endl; + } } out << indent() << "return " << error_ret << ";" << endl;