Permalink
Browse files

Fix minor memory leak

  • Loading branch information...
1 parent db7432e commit 7645624650a5ce6e6925e6c7b1019e213382491f @BjarniRunar BjarniRunar committed Nov 28, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 pkproto.c
View
@@ -607,9 +607,12 @@ int pk_connect(struct pk_conn* pkc, char *frontend, int port,
for (rp = result; rp != NULL; rp = rp->ai_next) {
rv = pk_connect_ai(pkc, rp, 0, n, requests, session_id, ctx);
if ((rv >= 0) ||
- (rv != ERR_CONNECT_CONNECT))
+ (rv != ERR_CONNECT_CONNECT)) {
+ freeaddrinfo(result);
return rv;
+ }
}
+ freeaddrinfo(result);
}
else {
return (pk_error = ERR_CONNECT_LOOKUP);

0 comments on commit 7645624

Please sign in to comment.