diff --git a/paddle/go/pserver/lib/client/test/main.c b/paddle/go/pserver/lib/client/test/main.c index 6fec3a7a83a616b37f8c12a726d58951c369c6ca..14d4522eac0b5908724e75c370f6ea8d78e6f60e 100644 --- a/paddle/go/pserver/lib/client/test/main.c +++ b/paddle/go/pserver/lib/client/test/main.c @@ -8,6 +8,20 @@ void panic() { *(void*)0; } +void releaseParam(paddle_parameter* param) { + if (param != NULL) { + if (param->name != NULL) { + free(param->name); + } + + if (param->content != NULL) { + free(param->content); + } + + free(param); + } +} + int main() { char addr[] = "localhost:3000"; client c = paddle_new_pserver_client(addr); @@ -51,6 +65,9 @@ int main() { panic(); } + releaseParam(params[0]); + releaseParam(params[1]); + if (!paddle_save_model(c, "/tmp/")) { panic(); }