Fix memory leaks

pull/2788/head^2
Craig Tiller 10 years ago
parent 9a0c10efc6
commit b933c2cd55
  1. 8
      test/core/util/port_posix.c

@ -153,6 +153,11 @@ static void got_port_from_server(void *arg,
gpr_mu_unlock(GRPC_POLLSET_MU(&pr->pollset));
}
static void destroy_pollset_and_shutdown(void *p) {
grpc_pollset_destroy(p);
grpc_shutdown();
}
static int pick_port_using_server(char *server) {
grpc_httpcli_context context;
grpc_httpcli_request req;
@ -180,7 +185,8 @@ static int pick_port_using_server(char *server) {
}
gpr_mu_unlock(GRPC_POLLSET_MU(&pr.pollset));
grpc_shutdown();
grpc_httpcli_context_destroy(&context);
grpc_pollset_shutdown(&pr.pollset, destroy_pollset_and_shutdown, &pr.pollset);
return pr.port;
}

Loading…
Cancel
Save