--- libaitrpc/example/tcli.c 2012/03/28 11:36:42 1.6.2.3 +++ libaitrpc/example/tcli.c 2012/03/28 11:52:44 1.6.2.4 @@ -17,12 +17,15 @@ int main() // cli = rpc_cli_openClient(100, 2, AF_LOCAL, "0.0.0.0", 11111); if (!cli) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); + free(blob43); return 1; } cli2 = rpc_cli_openBLOBClient(cli, 0); if (!cli2) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); + rpc_cli_closeClient(cli); + free(blob43); return 1; } @@ -38,6 +41,9 @@ int main() AIT_NEW_BLOB(v, 512); if (rpc_cli_sendBLOB(cli2, v, blob43) == -1) { printf("!!!!! blob error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); + rpc_cli_closeBLOBClient(cli2); + rpc_cli_closeClient(cli); + free(blob43); return 2; } else printf("Get BLOB = %x\n", AIT_GET_BLOB(v)); @@ -52,6 +58,9 @@ int main() // for (i = 0; i < 1000000; i++) if ((ret = rpc_cli_execCall(cli, RPC_REPLY, NULL, "BBB", valz, &arr)) < 0) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); + rpc_cli_closeBLOBClient(cli2); + rpc_cli_closeClient(cli); + free(blob43); return 2; } else { printf("ret=%d\n", ret);