diff --git a/src/plugins/c/c_message_plugin.cpp b/src/plugins/c/c_message_plugin.cpp index f672aba..0d188d8 100644 --- a/src/plugins/c/c_message_plugin.cpp +++ b/src/plugins/c/c_message_plugin.cpp @@ -313,7 +313,6 @@ CMessagePlugin::GenerateFunctionDefinitionSerialize(Message::Ptr message) ss << " if (status != 0) { break; }" << std::endl; ss << " tpl_dump(tn, TPL_MEM, buffer, buffer_size);" << std::endl; ss << " tpl_free(tn);" << std::endl; - ss << " return *buffer_size; " << std::endl; ss << " } while (0);" << std::endl; for (int idx = 0; idx < message->items().size(); idx++) { @@ -323,7 +322,11 @@ CMessagePlugin::GenerateFunctionDefinitionSerialize(Message::Ptr message) } } } - ss << " return 0; " << std::endl; + ss << " if (status) {" << std::endl; + ss << " return -1;" << std::endl; + ss << " } else {" << std::endl; + ss << " return *buffer_size;" << std::endl; + ss << " }" << std::endl; ss << "}" << std::endl; return ss.str(); } diff --git a/src/plugins/c/rpcs/crpc_server.cpp b/src/plugins/c/rpcs/crpc_server.cpp index 9d2d361..83040c6 100644 --- a/src/plugins/c/rpcs/crpc_server.cpp +++ b/src/plugins/c/rpcs/crpc_server.cpp @@ -101,7 +101,7 @@ CRPCServer::GenerateStructAPIWrapper(std::string service_id) const ss << " status = 0;" << std::endl; ss << " } while (0);" << std::endl; ss << " free(buffer);" << std::endl; -// ss << " free(base64_buffer);" << std::endl; + ss << " free(base64_buffer);" << std::endl; ss << " free(response_msg);" << std::endl; ss << " " << response_id() << "_Destroy(&response);" << std::endl; ss << " " << request_id() << "_Destroy(&request);" << std::endl;