fix test memory leak

refactor_docs
Helin Wang 8 years ago
parent d08c8ea7a1
commit 1c908df681

@ -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();
}

Loading…
Cancel
Save