Welcome! Log In Create A New Profile

Advanced

[PATCH] Fix resource leak - sockaddr is not properly freed

Lubos Uhliarik
March 02, 2022 08:14PM
# HG changeset patch
# User Lubos Uhliarik <luhliari@redhat.com>
# Date 1646269812 -3600
# Thu Mar 03 02:10:12 2022 +0100
# Node ID 317e1e4b0c7343c49e0e13fc59ac75a565521b67
# Parent a736a7a613ea6e182ff86fbadcb98bb0f8891c0b
Fix resource leak - sockaddr is not properly freed

sockaddr variable is allocated by ngx_resolver_calloc function but then it
is
going out of scope leaking the storage it points to.

diff -r a736a7a613ea -r 317e1e4b0c73 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Tue Feb 08 17:35:27 2022 +0300
+++ b/src/core/ngx_resolver.c Thu Mar 03 02:10:12 2022 +0100
@@ -4260,6 +4260,8 @@
}
#endif

+ ngx_resolver_free(r, sockaddr);
+
return dst;
}
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[PATCH] Fix resource leak - sockaddr is not properly freed

Lubos Uhliarik 470 March 02, 2022 08:14PM

Re: [PATCH] Fix resource leak - sockaddr is not properly freed

Maxim Dounin 69 March 05, 2022 09:00PM

Re: [PATCH] Fix resource leak - sockaddr is not properly freed

Lubos Uhliarik 101 March 08, 2022 04:36AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 62
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready