Fix memory leak in error path.
Signed-off-by: Patrick Marchand Latifi <[EMAIL PROTECTED]>
---
dapl/openib_cma/dapl_ib_util.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dapl/openib_cma/dapl_ib_util.c b/dapl/openib_cma/dapl_ib_util.c
index 0606312..6b282e5 100755
--- a/dapl/openib_cma/dapl_ib_util.c
+++ b/dapl/openib_cma/dapl_ib_util.c
@@ -131,8 +131,10 @@ static int getipaddr(char *name, char *addr, int len)
} else {
if (len >= res->ai_addrlen)
memcpy(addr, res->ai_addr, res->ai_addrlen);
- else
+ else {
+ freeaddrinfo(res);
return EINVAL;
+ }
freeaddrinfo(res);
}
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general