diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-09-26 13:21:43 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2008-09-26 13:21:43 -0400 |
commit | e36a9e8af8bba0ff661da3c8dc0656bfe9952767 (patch) | |
tree | 7335a76833e279d3d0ddadb89631cc595618bc81 /utils/statd | |
parent | 37130ec4041bd703d706207d77b4398ea252be5a (diff) | |
download | nfs-utils-e36a9e8af8bba0ff661da3c8dc0656bfe9952767.tar.gz nfs-utils-e36a9e8af8bba0ff661da3c8dc0656bfe9952767.tar.xz nfs-utils-e36a9e8af8bba0ff661da3c8dc0656bfe9952767.zip |
sm-notify command: getaddrinfo(3) addrinfo leak
Make sure the results of getaddrinfo(3) are properly freed in notify().
Note this is a one-time addrinfo allocation that would be automatically
freed when sm-notify exits anyway, so this is more of a nit than a real
bug fix.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/statd')
-rw-r--r-- | utils/statd/sm-notify.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c index 5a02394..b69f4cc 100644 --- a/utils/statd/sm-notify.c +++ b/utils/statd/sm-notify.c @@ -241,8 +241,11 @@ notify(void) opt_srcaddr); exit(1); } - memcpy(&local_addr, ai->ai_addr, ai->ai_addrlen); + /* We know it's IPv4 at this point */ + memcpy(&local_addr, ai->ai_addr, ai->ai_addrlen); + + freeaddrinfo(ai); } /* Use source port if provided on the command line, |