]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/sm-notify.c
sm-notify command: getaddrinfo(3) addrinfo leak
[nfs-utils.git] / utils / statd / sm-notify.c
index 5a023949191ad160e1edb8f57a06f97b7cf445df..b69f4cca886cd19086ee14496acc2c0f083a48e3 100644 (file)
@@ -241,8 +241,11 @@ notify(void)
                                opt_srcaddr);
                        exit(1);
                }
                                opt_srcaddr);
                        exit(1);
                }
-               memcpy(&local_addr, ai->ai_addr, ai->ai_addrlen);
+
                /* We know it's IPv4 at this point */
                /* 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,
        }
 
        /* Use source port if provided on the command line,