pam/pam-bsc1197024-free-addrinfo-before-return.patch
2024-02-05 14:46:13 +08:00

21 lines
616 B
Diff

Index: Linux-PAM-1.3.0/modules/pam_access/pam_access.c
===================================================================
--- Linux-PAM-1.3.0.orig/modules/pam_access/pam_access.c
+++ Linux-PAM-1.3.0/modules/pam_access/pam_access.c
@@ -801,10 +801,16 @@ network_netmask_match (pam_handle_t *pam
hint.ai_family = AF_UNSPEC;
if (item->gai_rv != 0)
+ {
+ freeaddrinfo(ai);
return NO;
+ }
else if (!item->res &&
(item->gai_rv = getaddrinfo (string, NULL, &hint, &item->res)) != 0)
+ {
+ freeaddrinfo(ai);
return NO;
+ }
else
{
struct addrinfo *runp = item->res;